Finding File Name And Using It To Place The Graphic Using VBscript

I'm trying to find a file name (example, <place:E:\logo.tif>) in each text frame if it's there, then remove the text from the frame and then place the file in the frame. This is to get around the feature missing from InDesign that is in PageMaker that allowed you to import inline graphics using tagged text. Below is what I have come up with so far. The file name is currently hard coded in the example below.
Thanks,
Archie
For I = 1 to cInt(myMountNumber)
Set myTextFrames = myDocument.TextFrames
Set myCurrentFrame = myTextFrames.Item(I)
If myCurrentFrame.Texts.ItemByRange (1,7).Contents = "<Place:" Then
Set myLastCharacter = myCurrentFrame.Characters.Item(-2)
myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents = ""
myCurrentFrame.InsertionPoints.Item(1).Place ("E:\sxs\pm65\Sundco.jpg")
myCurrentFrame.Fit idFitOptions.idProportionally
End If
Next

' For I = 1 to cInt(myMountNumber)<br />For I = 1 to myDoc.TextFrames.Counts<br />' I think your myMountNumber is equal to TextFramesCount<br /><br />' Set myTextFrames = myDocument.TextFrames<br />' Set myCurrentFrame = myTextFrames.Item(I)<br />' you don't need to get reference to ALL TextFrames in EACH iteration<br /><br />Set myCurrentFrame = myDocument.TextFrames.Item(I)<br />' get reference to Ith TextFrame in document<br /><br />' If myCurrentFrame.Texts.ItemByRange (1,7).Contents = "<Place:" Then<br />If left(myCurrentFrame.Texts.Item(1).Contents,7) = "<Place:" Then<br />' looks better and should be faster<br /><br />   ' Set myLastCharacter = myCurrentFrame.Characters.Item(-2)<br />   ' myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents = ""<br />   ' you don't need these lines - you will delete contents in PLACE line<br />   <br />   ' myCurrentFrame.InsertionPoints.Item(1).Place ("E:\sxs\pm65\Sundco.jpg")<br /><br />   myFile = Mid(myCurrentFrame.Texts.Item(1),8)<br />   ' get all after "<Place:"<br /><br />   myFile = Split(myFile,">")(0) ' get all to ">"<br />   ' small trick ;) when split - get array - but we can use (0) to refere to first element<br /><br />   myCurrentFrame.Texts.Item(1).Place(myFile)<br />   myCurrentFrame.Fit idFitOptions.idProportionally<br />End If<br /><br />Next<br /><br />and I don't think that iterating TextFrames collection is good way ...<br />you should iterate Stories collection and refer to first TextFrame - unles you are sure what you are doing ;) and you have Stories where each TextFrame will have image inside ...<br /><br />robin<br /><br />-- <br />www.adobescripts.com

Similar Messages

  • How do I find file names containing special character

    hi all
    I need your help with a code that deals with finding file names containing special characters like * / \ : ? " |
    the reason is I am doing a project that transfer files and folders from Mac to Windows. But names containing above characters cant be moved to windows.
    the part of the code I write is like this
    set illegal_syntax to paragraphs of (do shell script "find " & quoted form of POSIX path of oneFolder & " -name '*'")
    if (illegal_syntax is not equal to {""}) then
    repeat with each_record in illegal_syntax
    do shell script "/usr/bin/ditto -c -k -rsrc --keepParent " & quoted form of each_record & space & quoted form of (each_record & ".zip")
    end repeat
    end if
    First of all that '' will gives me an error.
    Second, what i tried to do is once the file/folder is found, zip it at current location. But the problem is how can I zip it without the special character? or should I just give it a name, like "originalfile.zip";?
    Last, or maybe you have better idea to deal with this situation? BTW, I can not rename or delete the file/folder because customer won't allow me to do it.

    The backslash is used to escape characters in AppleScript, so if you want to use it in a string you need to escape the escape character, for example "\\*".
    You could set the name of the archive by replacing the illegal character with another one, such as an underscore:
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; border: 1px solid #000000; width: 720px; color: #000000; background-color: #FFDDFF; overflow: auto">set each_record to "some*file*name" -- example
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "*"}
    set the ItemList to text items of each_record
    set AppleScript's text item delimiters to "_"
    set each_record to the ItemList as text
    set AppleScript's text item delimiters to TempTID
    log each_record --> some_file_name
    </pre>

  • Pdf portfolio source file name and date in file details

    Is it possible to import the source file name and extension as well as the source file created date in the portfolio file details?  Need to document source to portfolio in working with 3rd parties that will only have the original source.  Need to document what was converted into pdf as not all files in a directory will successfully convert to pdf.  Sometimes need to convert 100's of files.  Manual entry is inefficient.  the file names and modified dates are displayed on the Combine Files dialog.  is there a way to capture the detail on that page?

    I don't need the detail of when the pdf was added to the portfolio.  I
    need know which dwg or jpg or word file was converted and the original
    created date of that file for control of information.
    That is impossible; sorry. For some *very specific* types of conversion to PDF the pdfx:SourceModified XMP tag will be set to show the last-modification date of the source file (for example DOCX files converted using MS Word), but there will never be a human-readable record of the source filename or its creation date unless you have manually added them as document XMP properties after conversion (this is what the "Custom Properties" dialog is for). To embed source data automatically would raise no end of privacy and security problems for customers, who most certainly do NOT want their recipients seeing details of internal documents.
    Without writing a plugin there's no access to the internal workflow of the Combine Files dialog, so you cannot use a script to read the names and dates of the files *before* conversion and store them automatically in the new PDF Portfolio's Fields array.

  • File Name and Path special field

    Post Author: puser01
    CA Forum: .NET
    I have a report created in CR 9 with the File Name and Path special field on the report displayed correctly. when i try to run it on CR XI environment i get this:
    C:\WINDOWS\TEMP\{4D86438D-54F5-4EEF-A0AB-05D5EB2BFF35}.rpt
    How can i correct this?

    Our installer names don't make it easy for the new user, or the seasoned veteran for that matter. Although both those installers have 2008 in the name, they are for entirely different products.
    CRRedist2008_x86.msi
    This MSI installer is used to install the runtime for Crystal Reports Basic for Visual Studio 2008 - version 10.5.
    cr2008fp35.exe
    This installer package is used to install the CR .NET runtime for Crystal Reports 2008 - version 12.3.
    Since you've updated your development system to Crystal Reports 2008 you'll only want to use the runtimes listed on this reference page - http://www.sdn.sap.com/irj/sdn/crystal-xcelsius-support?rid=/webcontent/uuid/10e38d93-7f07-2d10-beae-e739182f8ada. [original link is broken]
    I suggest either of these
    SP 3
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    FixPack 3.5
    https://smpdl.sap-ag.de/~sapidp/012002523100006341772011E/cr2008fp35_redist.zip

  • Can I add the file name and page numbers to multiple pdfs automatically?

    Hello.  Thanks first for taking the time to read this!  We are a small non profit hospice.  Looking to take a large amount of files and put the patients last name (which is the file name) and a page number on the footer of every page of every document.  For example.  File Name Smith.  Smith 1 Smith 2 Smith 3 etc.  However I like to be able to do this to multiple files at once and not have to open each one up.

    Go to Advanced - Document Processing - Batch Processing...
    Click New Sequence and give it a name.
    Now select the sequence you've created, click Edit Sequence, click Select Commands.
    Select Execute JavaScript from the left-hand side, and click Add.
    Now select it on the right-hand side and click Edit.
    Paste the code from my previous post into the window, and click OK twice.
    Now, back in the Edit Sequence window, select the folder you want to run the batch on, and the output folder. Be aware that if you choose the same folder, the original files will be overwritten, so you might want to use a different one.
    Under Source File Options, deselect everything.
    Click OK.
    You're now ready to run the batch sequence!

  • How to print the report file name and path and the last mod date

    Good morning,
    I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
    Anyone would know how I can do that? I have checked the doc but found nothing.
    Thks. Philippe.

    Did you ever determine how to print report name and report last mod date?
    Thanks

  • File name and Date Display as an obj not the data

    All,
         The issue that I am having is that when I view a Visio file hosted on SharePoint. The file was created in Visio 2007 and when it is opened by Visio 2007 and Visio Viewer in SharePoint. The file name field object and date
    modified object show the information. The issue is when the file is opened by a device that has Visio 2010 the information does not show. Is there something that I can do for these users to have it show correctly.

    Hi,
    Which way did you open the Visio 2007 file in SharePoint?Opened it in the browser or downloaded it to open? I had test in my environment. Insert a text box>Add a data/time field, it worked fine both in Visio 2007, 2010.
    Thus, let‘s do some test to narrow down the issue’s reason. 
    1.Download the Visio 2007 file and open it with Visio 2010.
    If it worked fine, the issue seems more related to Visio object and sharePoint connection.
    If it does not display the information in Visio 2010 by a device client, the issue was more related to Visio 2010 client.  
    2.Create a new drawing included file name and Date
    field in Visio 2010.
    If the new drawing displays correct, the issue is more related the original, please try to repair the file or re-create the file name and Date filed.  
    If the new drawing still displays incorrect, please try to start Visio 2010 in safemode, some third-party add-ins my be casued the issue.
    If the issue still exists, try to repair Visio 2010.
    Regards,
    George Zhao
    TechNet Community Support

  • How to find ATL file name and timestamp of importing for existing DI code?

    A tester is not sure about the version of the ATL code which was imported into his local repository. Is there anyway he can get the imported ATL file name and/or timestamp from the repository or a log file? I searched in both places but couldn't find any information. Did I miss something? This is DI 11.5.3.
    Thanks,
    Larry

    I don't think the information about the source of how the object was created in repo is maintained anywhere, like this version of object was created from ATL or from Designer etc
    but different versions of objects are stored in AL_LANG and its language in AL_LANGTEXT table, if you have not compacted the repo, you may get the last modified time from AL_ATTR table, try getting the data from these table and see if you get any info that is useful for you

  • I can not download any files using Safari ? when I choose to download application file the URL include the file name and stop responding. Any help??

    I can not download any files using Safari ? when I choose to download application file the URL include the file name and stop responding. Any help??

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • How to find PG.xml file name and path associated with a FUNCTION

    Hi,
    I am having a function:IRC_VIS_HOME_PAGE with Web HTML value as below:
    OA.jsp?akRegionCode=IRC_VIS_HOME_PAGE&akRegionApplicationId=800&OAPB=IRC_BRAND
    How to find PG.xml file name and path assoicated with above funtion.
    Thanks,
    ashok

    Ashok,
    Function IRC_VIS_HOME_PAGE will have 2 parameter defined for it which are OASF and OAHP where
    OASF=<SelectedFunctionName> - this tells the Framework to select this function in the given "Home Page" menu context.
    OAHP=<HomePageMenuName> - this is used ONLY with the OASF parameter, and it is used to establish the current menu context. It should point to a "Home Page" menu.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • UDF to read a file name and use some of its contents to map fields in target.

    I have a scenario where I need to take the month and year from the file name and map it to suitable fields in the target. Ex - filename_apr2014 from this i should be able to read the month and year and map it. How to do this? I tried the udf -
    public String getFileName(Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return ourSourceFileName;
    got this error while testing the mapping -
    Runtime exception when processing target-field mapping /ns0:MT_<<>>_Output/I<<>>; root message: Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.get(com.sap.aii.mapping.api.DynamicConfigurationKey) of a null object loaded from a local variable at slot 2] in class <<>> method getSourceFileName[com.sap.aii.mappingtool.tf7.rt.Context@5b04fc0f]
    See error logs for details  

    Hi Satish - You declared "conf" twice.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    UDF -
    String filename    = "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
    filename = conf.get(key);
    return filename;
    And did you define the variable slot 2 in any of your UDF's?
    The above UDF return the filename and you should handle the sub string later..

  • Copy file name and info from finder window

    I need to get the file name and file size for lots of files in lots of folders into a text file or excel file. I have found the way to copy the file path into text edit, but can't figure out how to copy all the info in a file window. Is there a way to do this?

    It's easily done with Terminal.
    cd (drag folder into Terminal window, press return). Then:
    ls -l > ~/Desktop/list.txt
    A file called "list.txt" will appear on your Desktop, containing a list of files from the folder, along with their modification dates, file sizes, and ownership/permission info.

  • Save As with suggested file name and folder

    I would like the user to be able to press a save button on the pdf and the "Save As dialogue box" pops up pre-populated with a file name and location choosen. The user can then choose to name the file something otherwise or select a new location. I would just like to save them the steps of copying the field data and finding the correct folder (deeply buried on server) however to place the finished document in.
    This doesn't seem to require a trusted function, but how do I suggest the file name based on a field name in the document. And how do I suggest the folder the document should be saved into?
    Thanks in adavance.

    Hi,
    you need a folder level script to use the browseForDoc method.
    http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf#page=10 4

  • Printing FILE NAME and DATE PRINTED?

    when i was on a mac i used to be able to have a default in the printer dialog so that every page printed showed the file name and the data printed. i would like to do this in the mac but i am guessing that this has to be done in either the specialized software dialog box or perhaps in a mac dialog box?
    in any event, can anyone help me figure out where i might find a place to do this? i haveadobe acrobat but i wold also like to do it in something like Preview as well.
    TIA

    hotwheels 22 wrote:
    if i have documents coming that i print for a project and these are quite naturally coming from different software it i have no way now of being able to FIND this file in my computer when i am looking at it.
    Consider using Find from the File menu or Spotlight to search for the document. In one of your previous posts, you stated that you name documents with a date and name. Then perhaps search for the name. Also, with your method of naming documents, if the document is a letter, wouldn't the date on the letter and the person to whom the letter is addressed to give clues to the filename and thus finding it on your computer?
    this is a major organizational issue over here and customizing a template for all my various software should be unnecessary IMHO.
    I do not know how many documents you deal with but I do know that there a many organizations that deal with billions of documents. In addition, if you share documents with others or others with you, there is not a filenaming method that works for everyone. People adapt to each other. A date in a filename could have several forms such as month-date-year or year-month-date, two digits or four digits for year and so on and so forth.
    Are you saying it IS necessary to have this dual file type that has a Pages document which then prints a PDF?
    No. Please re-read  what I wrote and the Pages Help Center articles.
    also, is there in fact a way to save a PDF back out as a Pages document?
    Yes, re-read what I wrote (that which you quoted).
    "Acrobat has the capability to save a PDF in other formats such as Microsoft Word, which can be opened in Pages. That said IMO, a separate Pages document for each "custom" letter/report would not be necessary."
    alternatively i guess i could create a Pages TEMPLATE - that has a DATE in the header that automatically updates .../but/ i am realizing that this has the unfortunate consequence of having the DATE updated if i open the Pages document again
    But that is what you stated you wanted because
    ...and try to remember to SAVE AS this document with another name with the original FILE NAME but a NEW DATE. this does not always work and sometimes i write over the original accidentally.
    anyway, maybe the answer here is to create a Template for any new document type and simply use this template any time i need to create a PDF and then not save or delete the original Pages document but this seems a bit hairy and dangerous in terms of possibly losing a file if i forget to print to PDF or something.
    You have redundant backups, yes?
    It seems that your understanding of a template is different from what it actually is, its purpose and its use. If you have not already done so, try using one of the included Pages templates to create a document that you would reuse to get a better understanding of how it works and to help determine your workflow. What you wrote in the last post seems to be a lot of what ifs but not hands on experience with the software itself. My response was based on my experience of using many types of software and in particular to your questions, Pages and Acrobat. Perhaps you will find better responses in the Pages forum and for Acrobat there is a forum at the Adobe web site.
    is there a lock file functionality in Pages in Mountain Lion or was this in Lion?!
    Perhaps reviewing the tutorials for Pages or searching with Google would  help answer many of your questions.

  • How to view long file names and sort files within folders/projects?

    Hello, like so many people here, I am a new mac user, but certainly not computer illiterate. I have been a professional photographer for 10 years and recently change to mac and have been slowly trying to adapt my work flow accordingly.
    However I have become increasingly frustrated with Aperture 3 and after reading posts here it looks like I am certainly not the only person. While in my case I am sure it is because of my inexperience with mac systems so any guidance or assistance is much appreciated.
    Hopefully my questions are simple. I have been importing my images and re-naming images as I do so. A very simple combination of date, custom name, and counter. However, when I look at the images once the import has completed, they are not in any logical order within the 'project'. I have tried to sort them by file name, orientation, file size, etc, both ascending and descending, but they will not list in the correct order. eg the file '2010-03-09 Lyon France 001', continually falls between '2010-03-09 Lyon France 022' and '....021'.
    This has also lead me to a further question. While my file names can generally be read when the image is a landscape format, on the portrait images the file name it too long for me to read the whole name, and I can not find anyway to read the file name, eg browser, split screen, viewer, or full screen.
    Im sorry for all the details, and I am sure it is just my lack of experience, so appreciate your help.
    PS. On a separate note, I notice on another thread from the frustrated user 'ultratechy' that he got a reply from Tony who stated 'Also after installing any application you should always run disk utility and repair permissions....' Now as I am completely new to mac, I had no idea about this. Any other tips that I should always be aware of? Thanks again.

    Thanks for your reply Calx. If it makes you feel better, I am actually a New South Welshman - just living in the sunshine state!
    You are correct, I am trying to get my head around a new way of working and thinking, but I suppose it will all become clearer as time goes by. I have re-visited the manual many times, and been doing loads of research online, but just trying to put it all into practice now, so any tips or advice is always appreciated.
    At the moment, I am just working with a small part of my library until I do get my head around things before moving onto the bulk of my images. I have my images stored and backed up on multiple external hard drives. I am trying to import my images into aperture from an external drive as I have been slack over the years with keywording, metadata, organising, etc etc, so I figure from what I have read that aperture may assist me with making these time consuming tasks a bit quicker and easier.
    I have put a bit of thought into my filing structure, but I am sure that with further use and understanding, this may change in the future, but I hope not. To give you an example of how I am thinking and working - I have used folders for my regular clients, eg, Ray White, and then made another level of folders within 'Ray White' for the date, and then in each 'date folder' I place my projects and name them with the address of the property I have photographed. I select and edit images from each project and place them in albums under each project. Not sure if this is the most perfect structure, but any advice is welcome.
    Keywords is always an issue with me. Over the years I have compiled a number of list for each client and each 'type' of photography. For example, real estate images have there own list, I just simply manually add keywords for specific jobs, eg the address and any specific location or features.
    Again, advice and guidance always welcome and I would appreciate how you go about these topics? And maybe you can help explain something that I have pre-emted may be a problem, and it may happen when I move onto my larger library, and I am not sure how to explain this as it may show my lack of management previously. When I worked on my PC, I used PS4, Adobe Bridge and Camera RAW pretty much exclusively. For my landscape images for example, I might have 2 or 3 variations of the one images, eg, black and white, sepia, and color for instance. But the file name remained the same, I just stored them in different folders indicating what version of the image was stored there. Now I am thinking that when I import images in Aperture, I will come across difficulties because Aperture will think the I am importing duplicate images because I will in fact have 3 images with the same file name, even though the adjustments I have made to them are different. Is this the case? Will I have to make adjustments again? Will I have to change the name of the files prior to importing? If so, any advice or tips?
    Well, I should stop there. Im sorry to bombard you with some much text, but as mentioned, I am new, and finding my feet, so thanks for your time.

Maybe you are looking for

  • Global attributes in a template project

    Hello folks, We are setting up a demo of global template functionalites in SM. In the template project we have created we need advice on how to go about with the following. 1) What do the attributes - global, local, harmonized etc.mean from a busines

  • Windows XP with Outlook 2007 authentication prompt

    We have successfully migrated some of our users from Exchange 2010 to 2013 - the ones running Windows 7 and Office 2007 and Office 2013. We have some users with Windows XP and Office 2007 though and when they start Outlook they get prompted to logon

  • Video Clip is Sharp in the Bin, but Blurry When Included in Project?

    I have a JVC Everio video camera and iMovie '11.  I'm doing a fairly tight shot.  When I import the clip into the iMovie clip bin, it is sharp. But when I move the clip into the project for inclusion in the final movie, it becomes blurry.  The camera

  • Enter GL account

    Hi Friends, In the VKOA I have defined the data for combo (V/KOFK/Ch Ac/Sales org/DC/AAg/AAG/orderAAG/Act Key/GL account) But when I am creating standard debit memo request and chkng incompletion log showing as complete but when am saving getting err

  • Photoshop elements 12 will not connect with Revel Premium

    I am using Windows 8.1 and I upgraded to Elements 12 from Elements 8 in August 04.  I also have Revel Premium.  For a few weeks I was able to move photos between PS and Revel.  Now this has changed, for I am no longer able to access Revel from Photos