Change file path of embedded pictures

I'm sort of a beginner with Applescript, but I created an application in it that takes screenshots of different web pages and saves them in my Pictures folder. I have a proposal template in a Word document that has these pictures linked and embedded into it. Whenever I want to create a new proposal, I run the application and get the specified images I need, and update the links in the Word doc so that the new images display. I then break the links and save the doc as something else. 
Anyway, I have a colleague who would like to use this application. The files in the Word doc are linked to Macintosh HD/users/Me/Pictures. How can my colleague easily set all the images in the Word doc to their own file path, ie Macintosh HD/users/MyColleague/Pictures?
Something like
          tell application "Microsoft Word"
                    set the path of active picture to "Macintosh HD:Users:MyColleague:04-ReportMenu.jpg"
          end tell
Multiple salespeople will eventually be using this script. If I could add a function into my Applescript app so that whenever the proposal template is opened, the path to the images is changed to that users's picture folder, that would be amazing. Other solutions are welcomed.

Sure, thanks for the reply. My organization created a sales proposal generator in Word. It creates a sales proposal based on some user inputs. Embedded in the proposals are demonstrations of our product in the form of screenshots of our product from our website. One of our designers updates the standard images with customized branded images for the client we are pitching. It's very time consuming to get these new branded images from the web, crop them and swap them out in the Word proposal, so I created an app that will do it. The app visits a list of pages, takes a screenshot of the Safari window and pastes a named image in my Pictures folder. I embedded the images in the Word doc so that they link to my Pictures folder. All I have to do is update the links and I have a new branded proposal. It works great on my own machine, but if I share it, the path obviously breaks and the Word image update doesn't work.
Here's a snippet of my code. The following takes a screenshot of our site and saves it in Pictures:
  -- Report Screenshot
  delay 1
                    tell application "Safari" to set the bounds of the front window to {0, 20, 915, 935}
                    delay 0.1
                    tell application "Safari"
                              tell window 1 to set URL of current tab to "https://website.com/demox?rm=report"
                              delay 4
                    end tell
                    do shell script "screencapture -o -l$(osascript -e 'tell app \"Safari\" to id of window 1') ~/Pictures/05-Report.jpg"
          end tell
The links in Word update to the brand-specific images I just grabbed once I select Edit -> Links -> Update Now
I need a quick way, in Applescript, to update /Users/me/Pictures/photo.jpg to Users/MyColleague/Pictures.jpg in Word. Does this help at all??

Similar Messages

  • Changing File path for different TIFF files in a For loop

    Hi dear users:
    I am using "IMAQ write TIFF File.vi" that basically writes a TIFF file to a specified file path. However, I would like to CHANGE the file path for each TIFF file i save in a for loop. The reason for this is that the File path has to include the file name and I do not want to write over the same file name all the time in a for loop. What I would like to have are sequential TIFF images. So if the file name would be "Image", I would like the result to be Image0, Image1, Image2 and so forth when I run my For loop. Can anyone help me with this?
    Thanks

    Use the "Format Into String" and the "Build Path" functions:
    Message Edited by smercurio_fc on 06-26-2007 05:16 PM
    Attachments:
    Example_BD.png ‏3 KB

  • Imported web app image file path shows no picture

    I am trying to import a file path into the image (type) field of a web app, but the image does not appear on page. If I go into the web app item, do nothing but click 'update', the image will appear on page.
    I have tried importing using Auto-Detect, Comma delimited (CSV), and Tab delimited with the same result. I have exported the .CSV from Numbers (app), and tried copy/paste into TextEdit for Tab delimited. Text is UTF-8.
    Is there some trick to getting the import of a file path to work? Do I need to escape the "/" in the file path (ie.   /_assets/images/<filename>    to    \/_assets/images/<filename> )?

    As I am still testing this web app, I uploaded an image through dreamweaver, then went to the web app, clicked the 'select image' link next to the Image field, and continued to fill in the other info.
    Once that was done -- so I had one example web app item in the spreadsheet -- I exported the template, filled it in with additional data, and imported in the various ways described. I am only using the one image. http://mainedreamvacation.businesscatalyst.com/specials
    I get this image visible on page, I had to go in and update each web app item. Tedious for testing; impractical otherwise.
    Thanks for your help,
    Tim
    Graphics / Web Specialist
    Adventure Advertising
    29 Commercial Street
    Rockport, Maine 04856
    207-236-8049

  • Multiple clips from 1 original file..& Embedding pictures

    Hi! Is there any way to place multiple In/Outs in one source file. (i.e) Edit a file into several smaller files at the same time? Right now I import a new source file, create a subclip,rename it, then reimport it to create a different subclip...
    Also when I insert a picture in between movie clips in the timeline, the picture appears uncentered in the program window. It looks fine in the source window. Should I resize the picture to a certain size?
    Thanks,
    S

    Drag your source clip from the Project Panel into the
    Source Monitor. Set the desired in and out points, then drag from the Source Monitor to the timeline.
    Now return to the source monitor and
    change the in and out points as desired and drag to a new place on the timeline.
    Repeat and rinse. :P
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • Replacing files (changing file path) and keeping playcounts

    Hello!
    First of all, sorry if this a little bit confusing, english is not my first language.
    I'm thinking about moving my library and music files to an external HD, but I also would like to organize my music folders differently from the way iTunes does. I don't just want to lose my playcounts/last played info, but I know iTunes will not be able to locate the files if I change them.
    Is there a way to make iTunes locate the new files and replace them while keeping the playcounts? Will I have do to this manually (one file at a time) or is there a better/quicker way to do this?
    Thank you very much

    First let me play devil's advocate... Is there a really good reason to go for a manual folder structure? iTunes and just about any other media player will catalogue your media and then it will know where to find things. You shouldn't need to use Windows Explorer to locate your music, so why does it matter?
    That said, if you do want things your way then the you really need to automate the process of moving files and then reconnecting them to the library. Personally I dislike iTunes for Windows 40 character file & folder name limit and character substitutions. I have a custom layout that I used to use on my old iRiver that I'm reluctant to let go of, for example Comedy, Classical & Soundtracks all get their own subfolders, artists are broken down into A-Z folders etc. To make sure everything goes where I want it I use a custom version of my script ConsolidateByMoving. If you understand a bit of BASIC you should be able to customize my script for your own set of rules.
    Note that you should still stick to the basic stucture of an iTunes folder containing the library files and inside it an iTunes Media folder containing the media in any layout you like. Keeping this overall layout makes backing up and migrarting the library simple. If you split the media folder from inside the library folder then transfers will often break the links between the library and the media.
    tt2

  • Can I change the file path that itunes reads my music files from? 65000 files trying to be transferrd from external to internal HD. I dont want itunes to manage my collection, just read it. thanks

    Can I change the file path that itunes reads my music files from?
    I have about 65000 music files that i have transferrd from my external to a new laptop internal HD.
    I have organised the folders myself as I use a PC and do not want itunes to organise the folders because when I'm searching through music on windows it is sorted out by artists/albums with 'the...(eg  The Beatles)' under 'T' instead of 'B'.
    Long story short.... Is there any way that I can keep my itunes library as it is on the external HD and copy it to the new laptops C drive, keep all the info (playlists etc) and still have the same folder structure as on the external HD?
    Or, is there any way of making windows sort things in alphabetical order like it is in itunes (eliminating the 'the' issue)?

    The files that weren't inside the media folder on the original machine need to be copied over to exactly the same paths as they had on the source machine. See this thread for an ongoing discussion of a similar problem. See also this post on migrating the iTunes library.
    tt2

  • External hard drive -- old file path from a previous laptop is still where to find my songs,  how do I change?

    My iTunes library is a mess, it is stored on an external hard drive.  My old laptop died unexpectedly and I didn't have a problem resetting the file path for the library on my new laptop.  The other day my son was trying to update his iPod when I wasn't home and I don't know what he did.... GRRRR  Any songs I purchased on my old laptop are now not able to be found.  When I click on 'get info' on a song it shows the old file path from the old laptop.  Songs that I purchased since the new laptop are still playable and great.  I know my songs are still there but I can't seem to get the file path to reset on the old music.  HELP!!! PLEASE

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or an external drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • I cannot play music from my library on either my external drive or my laptop - keep getting same message "___ song (all of them) could not be used because the original file could not be found. I have tried changing the path in prefernces many times.

    I cannot play music from my libray on either my external drive or my laptop. I keep getting the same message - "___ song (all of them) could not be used because the original file could not be found. Would you like to locate it?" I have changed the path several times under preferences and it still won't recognize any songs from either my laptop hard drive or my external drive. I can't play any music at all.

    I think I've fixed this on my machine.  If you look in the ITunes folder there is a subfolder called Previous iTunes Libraries.  In my case for some reason this contained the one which had always worked and a new one was in the main  folder.  I closed iTunes, deleted the new one, and moved the old one back to the main folder, then opened iTunes.  It then rebuilt the library and it plays correctly.  Hope it works for you.

  • Changed file directory path on new drive...how do I import my music and playlist?

    Previously I had relocated my iTunes library successfully to an internal secondary drive on my old PC.  Years later, my PC crashed and i had to reinstall everything, also upgraded from xp to Win7.  Due to preference' storage, I installed iTunes (v11) onto my c drive, but want my iTunes library on my secondary d drive. Should mention that I was able to saved all my iTunes music and apps from the crash.  So I installed iTunes on c drive.  Obligatory iTunes media file was installed by program default into my music, of which I deleted.  I opened iTunes and set media file path in advanced setting to d:\itunes, which is the folder that I have prior sub folders for music, apps, TV, movies, etc with xls and itl file as was previous before crash.  Closed and reopened iTunes. Did not recognize library.  So then I moved xls and itl file out of the folder to desktop, closed and reopened.  Recognized some music, and wanted me to download from the cloud music that was physically in the folder.  No apps recognized. Wanted me to turn on home sharing, which I don't think will work in my case as I have no oither computers running itunes .  as there was no option to import a library in v11, I deleted this version.  Next, I installed version 9 from apple support site.  Again deleted iTunes media folder (empty) set by default in my music on c drive.  Set file path in. ITunes advanced tab to d:\itunes as previous, where library is now located.  Then imported xls file in iTunes folder on d drive through library tab.  This worked to a point.   All music in iTunes music folder and playlists were now showing in iTunes.  Apps are not.  Yes, have app tab checked.  Also, when xls file was imported, new iTunes media file folder was recreated in my music on c drive, and duplicate copies of all music files imported from original music folder on d drive were created within the iTunes folder on d drive.  Clarification: my library is set up on d drujve as such: have a main iTunes folder, then sepereate subfloders for TV, music, apps, books, etc., versus having a iTunes media folder containing all these separate subfolders.  So you can imagine, had original music files in music folder, and then had duplicate music files created in the original iTunes folder intermixed with music, app, books sub folders as a result of this step.  Also tried placing music, books, app folders into a media sub folder, with no change.  Never even got to step of syncing ipad.  Just trying to re establish previously working library.  Sorry so long a message.  Stumped.  Help!

    Copy the entire iTunes folder from the old computer to the new computer.

  • How can I do the same as Windows Explorer with datemodified:11/6/2013 .. 11/13/2013 showing only changed files with path in tree and NOT every folder along the way as Finder seems to do by default? Thanks!

    I'm an Apple newbie.
    I'd like to be able to list each file in the "Desktop" tree (ie; on the desktop, or in any folder on the desktop, etc.), along with its path, that has been modified since a certain date.
    When I use Finder to do a similar search, I get tons of output including every folder in the path to the modified file, etc. Although I can view the path to the individual files in the output, I can't for example, order the output by path, etc.  Very difficult to sort through. I'd love to have output like the example above - just the filename and path for each changed file.  Possible?  Thanks in advance!
    Wayne

    The file structure is a little complex. I will use inbox as an example.
    Inbox (a large file with no file extension)
    Inbox.msf ( An index of inbox with tags etc. Can be deleted with only loss of tags)
    Inbox.sdb (a folder, indicating that the folder within Thunderbird has a sub folder.
    POP mail is stored in
    Appdata/Roaming/Thunderbird/Profiles/*.default/Mail/[Server name]/
    Local folder is stored in
    Appdata/Roaming/Thunderbird/Profiles/*.default/Mail/Local Folders/
    As long as you do not overwrite, you can copy and paste whole folder trees into local folders (stuff on your old computer under a mail account is best relocated to local folder and then sorted as necessary afterwards.
    Note that you should delete foldertree.json after making those sorts of copies (it forces a full refresh of the folder tree, no cache) and under no circumstances copy data with Thunderbird running. It can irrevocably corrupt things

  • File path control-how to avoid the user to change the path string

    Hi all,
    I'm using "File path control" to chose file name. I don't want the user to write the path in the control directly (by typing) but only to choose the file via the button on the right.
    I can implement this behaviour with path indicator and button of course. But I belieave that it can be done more elegant - only disable the part with the string - not the whole "File path control". But how? I tried to customize the control but not success.
    Is it possible?
    jochynator
    LV 8.0.1, WinXP Pro
    Attachments:
    Path.vi ‏44 KB

    The way I've done it is to make the path part of the control tiny and hide it behind a string indicator.  Then whenever the path control changes value (by pressing the Browse button), I populate the string indicator with the path value.  Here's a sample VI demonstrating this method, saved in LabVIEW 8.0.
    Hope this helps,
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    path_browse.vi ‏12 KB

  • Changing physical path in FILE TCODE using ABAP CODE

    Hi all ,
    I want to change physical path linked to logical path in TCODE FILE dynamically using ABAP program. Is it possible.
    If yes then how?
    Thanks for your help.
    Regards,
    Uday.

    s

  • How to change the path of sysprep files that were copied to reference computer when i capture the image from reference.

    Dears ,,
    how to change the path that sysprep were copied to reference computer when i capture the image from reference.
    Should i modify some codes in LTIAPPLY.wsf? how to modify it?
    Thanks.

    Sysprep and capture has *Three* steps.
    1. Run sysprep on the local machine (easy).
    2. Copy WinPE down to the local machine so we can reboot into winpe for capture.
    3. Capture the drive in an *offline* state from within WinPE.
    What is most likely happening is that you are having problems with step #2. 100MB is *WAY* too small to copy down WinPE. By default MDT will make this System partition much bigger, 499MB. IF you install Windows 7 from the default media. IT will only create
    a 100MB partition.
    By default MDT 2012 Update 1 and greater *should* recover to a fallback drive with the OS on it, however if you are running older versions that might not happen correctly.
    If you are still having problems, copy your BDD.log file to a public share like OneDrive and copy the link here.
    Keith Garner - keithga.wordpress.com

  • FLEX debugger not hitting breakpoints, because Flash sometimes embeds source file paths with wrong letter case?

    I was trying to figure out why breakpoints were working fine for source files in some locations but not others.  FlashDevelop's debugger (which I believe is actually the FLEXSDK debugger) was successfully connecting, tracing output, and hitting breakpoints in SOME files, but not others.
    I downloaded SWFInvestigator from Adobe Labs and checked the embedded debug paths for various source files to see what was going on.
    I discovered that files in which no breakpoints could be hit had their paths embedded in all lowercase (e.g. "c:\users\username\desktop\source\myproject" instead of "C:\Users\username\Desktop\source\MyProject").
    So I have two questions:
    First, is this a Flex debugger issue, or a FlashDevelop plugin issue? Letter case shouldn't matter or interfere with matching file paths in Windows.
    Second, what could possibly influence the letter case of embedded paths in a SWF output by Flash Professional (CS6), such that they are sometimes all lowercase and other times maintain the same case from the file system?  And why would that affect a debuggers ability to hit breakpoints in Windows 7?  I am compiling in multiple ways. Sometimes clicking Publish within Flash. Sometimes the file being published is not even open in Flash, and my JSFL script file is passed to Flash.exe containing embedded file paths to open the document. Usually, everything seems to work fine, no matter where I publish from, regardless of whether the FLA file is open or not. I'm honestly starting to believe that it depends on how the FLA was last opened in Flash Professional, as though it saves some sort of last access path internally and uses that to embed debug information.

    I don't think it's the source path in my case, because it's simply the dot ".", although I did check that because it would most likely influence the embedded paths.
    In the library path, I use relative paths exclusively, since all my individual project folders exist in the same "source" folder.
    Here's how I arrived at the conclusion that something more complex or "stateful" must be occuring:
    I publish my files with a one-click application, which does the following
    updates version timestamps (static constants) in specific files via regex match
    fills in a JSFL template with the FLA filename and writes the JSFL file to disk, then passes the JSFL file path to flash.exe for publication
    the JSFL then runs a command, which signals the main application via cross-process communication that the script has finished publishing
    That all makes it easy for me to update and publish multiple projects and deploy them, with a single click.  Here is the JSFL template I created, which has been drastically simplified since the days where it used to search to see if the file was open in Flash, select the document, and call publish.  Now it just uses the publishDocument method to silently publish files without opening them.
    var filepath = "FLAFILEPATH"; //template parameter: the URI (beginning with "file:///") of the FLA file to publish
    fl.publishDocument( filepath, "PUBLISHPROFILENAME" );
    FLfile.runCommandLine("COMPLETECOMMAND");
    The C# app replaces the strings in all caps with the actual values.  The COMPLETECOMMAND is actually populated with the application's own executable path, along with a "complete" switch, which lauches a 2nd instance, which handles the complete switch by broadcasting a signal over an interprocess channel and then terminates.  The main instance captures the signal, triggers a wait handle, and continues with publishing the next file.  Here is the core code for it:
    private string fillTemplate( string fla_directory, string fla_filename, string publish_profile_name )
        string fileuri = "file:///" + Path.Combine( fla_directory, fla_filename ).Replace( '\\','/' );
        return EmbeddedResources.OpenAndPublish //JSFL template file embedded as string resource
            .Replace( "FLAFILEPATH", HttpUtility.JavaScriptStringEncode( fileuri ) )
            .Replace("COMPLETECOMMAND", HttpUtility.JavaScriptStringEncode( "\"" + Application.ExecutablePath + "\"" + " -publishcomplete" )) //call self with -publishcomplete switch to signal main instance's publishCompleteSignal
            .Replace("PUBLISHPROFILENAME", HttpUtility.JavaScriptStringEncode( publish_profile_name ) );
    private static readonly string FLASH_PATH = @"C:\Program Files (x86)\Adobe\Adobe Flash CS6\Flash.exe";
    public void publish( string fla_directory, string fla_filename, string publish_profile_name )
        Program.publishCompleteSignal.Reset();
        string template = fillTemplate( fla_directory, fla_filename, publish_profile_name );
        string curdir = Environment.CurrentDirectory;
        string tempJSFLfilepath = Path.Combine( curdir, "temp_script.jsfl" );
        File.WriteAllText( tempJSFLfilepath, template );
        Process p = Process.Start( FLASH_PATH, tempJSFLfilepath );
        Program.publishCompleteSignal.WaitOne( 30000 ); //timeout after 30 seconds
    Here's where it gets interesting.  The FLAFILEPATH has ALWAYS been passed in as all lower case, yet this publication method has worked 99% of the time for hundreds of publish operations every day.  This applies to both the publication of the first SWC, which is referenced by the second published SWF (both were being published with lowercase paths), yet the paths for the main SWF were remaining in lowercase, while those in the referenced SWC were maintaining the correct case from the file system.
    So there may be any number of things going on here.  SWCs may be published differently than SWFs, such that SWCs always have the correct letter case for debug source files, regardless of how the source FLA project was opened.  Ensuring the path passed to publishDocument uses the right case definitely fixes the problem, but it doesn't explain why it usually worked, despite having always been passing a lowercase string.  The only variable I can think of in all of this is Windows itself or Flash, such as whether the document was open in Flash at the time the silent JSLF publishDocument command ran, and how that FLA was last opened (via shortcut, via "recent documents" in Flash, via recent documents in Windows.  It has to be something, even if it's something as obscure as how the folder path was last accessed in windows, although I strongly suspect it's just how (in terms of path case) the FLA was last opened in Flash.
    In any case, I'm happy that passing the right case to JSLF's publishDocument command fixes the problem, so I'm not going to spend any more time trying to figure out how opening the FLA in various ways could affect the embedded debug paths.  The only thing that should be done is to address how paths with the wrong case are handled when they do get embedded that way for whatever reason.  Perhaps the flex debugger should be updated to use case-insensitive matches in case-insensitive file systems, unless, perhaps, this is a FlashDevelop debugger issue after all.

  • I'd like to change the dfault file location, C:My pictures, to another file location, eg E or G. What can I do to change it?

    See above question.

    Hi trshaner,
    Thanks again for your complete reaction. I’ve looked at the video and the help-information. This made me decide to leave the file My pictures where it is (C) and move some of the other folders/files to the E-drive. Thanks for your help.
    Met vriendelijke groet,
    Aad Oudshoorn
    Edelsteensingel 166
    2719 RC Zoetermeer
    06-22250606
    Van: trshaner 
    Verzonden: dinsdag 22 juli 2014 20:09
    Aan: Aad Oudshoorn
    Onderwerp:  I'd like to change the dfault file location, C:My pictures, to another file location, eg E or G. What can I do to change it?
    I'd like to change the dfault file location, C:My pictures, to another file location, eg E or G. What can I do to change it?
    created by trshaner <https://forums.adobe.com/people/trshaner>  in Photoshop Lightroom - View the full discussion <https://forums.adobe.com/message/6573614#6573614>

Maybe you are looking for