Applescript -- save file

Hi
I'm trying to built me a Filemaker Database which works pretty ok. Unfortenately, Preview make some trouble, because i can't open an image, edit it, then copy paste the drawing and close the picture, without that preview writes my changes to the image.
Until know, I'm using:
activate application "Preview"
do shell script "open ~/Desktop/Basket/fullcourt.jpg"
It opens the correct file. But know i need applescript to save the image to fullcourttmp.jpg, so the original file is not overwritten.
How do i tell applescript to do that?
Thanx in advance

How do i tell applescript to do that?
Well, the obvious solution is to duplicate the file first and then open that copy:
do shell script "cp ~/Desktop/Basket/fullcourt.jpg ~/Desktop/Basket/fullcourttmp.jpg && open ~/Desktop/Basket/fullcourttmp.jpg"

Similar Messages

  • AppleScript save email to pdf file issues

    HI,
    1. Can I use AppleScript save Apple mail message to pdf file, I mean not using GUI script.
    2. If possible for point 1, can it save the email message to network folder?
    Thanks in advance.
    patrick

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether your 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:
    Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
    When you see the gray Apple logo, release the shift key.
    If you are prompted to log in, type your password, and then hold down the shift key again as you click  Log in.
    *Note: If FileVault is enabled under OS X 10.7 or later, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode. 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 next normal boot may also be somewhat slow.
    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. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Applescript "save as" to a specified path

    First let me say that I have looked everywhere and just can't figure out if I can find the answer so i thought I would ask here.
    I had created an applescript (a long, way of doing it) that worked until my Adobe Acrobat Pro got upgraded from 9 to X.  But now at the same time, I am trying to figure out if there is an easier process than what I have been dealing with.
    the backstory:
    I manage a internal creative department for a company and we get requests from around the company for projects.  I have developed a PDF with forms that they fill it out.  When it gets emailed back to me, I have tried to figure out a system to get it from PDF into Filemaker Pro 9.
    here's what I want to do:
    once I open the submitted request in acrobat, here are the steps that I would normallly do (have developed a script for it, see below each step)
    (1) Save File As "report.pdf"  to a specified folder [Macintosh HD/Users/myname/documents/projects/pdf2fmp/exportpdf]
    *****this is because occasionally the requester will change the PDFs name if they chose to save it on their computer, believe me it makes it easier; also I just resave over it each time because I only need this as a temporary solution******
    tell application "Adobe Acrobat Pro"
        activate
    end tell
    tell application "System Events"
        tell process "Acrobat"
            click menu item "save as..." of menu "File" of menu bar 1
            keystroke "report"
            keystroke tab
            delay 1
            keystroke "g" using {command down, shift down}
            keystroke "/users/kellyf/documents/projects/pdf2fmp/ExportPDF"
            keystroke return
            keystroke "s" using command down
            delay 1
            keystroke "r" using command down
    (2) Open Forms / Manage Form Data / Merge Data Files in Spreadsheet..."
    ******I need to do this step to be able to import into FMP 9*****
    (3) from there I go an select the report.pdf file from the exportpdf folder that I just saved it in
    ******This is why I keep it the same when I save it so it can be scripted to pull it*****
    (4) then I save the exported data to be a report.csv file but in a different folder path [Macintosh HD/Users/myname/documents/projects/pdf2fmp/importCSV]
    ******I resave over the latest report.csv file for the same reason
    (5) from there I close the dialogue box
    tell application "System Events"
                tell process "Acrobat"
                    click menu item "Merge Data Files into Spreadsheet..." of menu 1 of menu item "Manage Form Data" of menu "Forms" of menu bar 1
                    keystroke return
                    delay 1
    keystroke "g" using {command down, shift down}
                    keystroke "/users/kellyf/documents/projects/pdf2fmp/exportpdf"
                    keystroke return
                    delay 1
                    keystroke (ASCII character 31) -- Down   
                    delay 1
                    keystroke return
                    delay 1
                    keystroke tab
                    delay 1
                    keystroke return
                    delay 1
                    keystroke "g" using {command down, shift down}
                    keystroke "/users/kellyf/documents/projects/pdf2fmp/ImportCSV"
                    keystroke return
                    delay 1
                    keystroke (ASCII character 31) -- Down   
                    delay 1
                    keystroke return
                    delay 1
                    keystroke tab
                    delay 1
                    keystroke return
                    keystroke "s" using command down
                    delay 1
                    keystroke "r" using command down
                    delay 1
                    click button "Close Dialog" of window "Export Progress"
                end tell
            end tell
        end tell
    end tell
    The rest of it for import into FMP works fine, it's just these previous Acrobat steps that are difficult. And I think I have made too difficutl.
    tell application "Adobe Acrobat Pro"
        close document "report.pdf"
    end tell
    delay 1
    tell application "Finder"
        activate
        open file "Creative Job List.fp7" of folder "Filemaker Pro Databases" of folder "Documents" of folder "Kellyf" of folder "users" of folder "macintosh hd"
    end tell
    tell application "FileMaker Pro"
        activate
        do script "PDF2FMP Import"
    end tell
    Again, this only works with Acrobat Pro 9.  But it does the job. 
    Additional question:
    If the scripting is too much to change, is there a way when I run the script out of X that I can be sure it opens 9 and just runs it?

    I need it 1 level up no matter where - since there will be different folders.
    Thanks!

  • IWork: Bought as an app but never got serial number so I can't save files??

    iWork: Bought as an app but never got serial number so I can't save files??

    This means that at some time you had the iWork ’09 trial installed. You need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user. Yvan Koenig has written an AppleScript that removes the files. You can find it on his box.com account in for_iWork'09 > other_iWork'09 items > uninstall iWork '09.zip.

  • Save file just created in QuickTime, How???

    I create new file (AAC, audio) in QuickTime by paste some tracks into one QT-document. Then I need to save this new soundtrack. I do following:
    tell application "QuickTime Player"
    tell application "Finder"
    set the temp_folder to (make new folder at desktop with properties {name:"_JoinToAudiobookTempfolder_"}) as alias
    end tell
    set the new_file to ((temp_folder as text) & "temp_file")
    (* Some Code *)
    save movie 1 given «class dfil»:file new_file, «class savk»:self contained
    end tell
    But QT doesn't save file on folder "_JoinToAudiobookTempfolder_" on Desktop! It shows windows "Save File As" and wait that I specify location and file name! Why?

    I understand. So, I decided to change the order of
    processing :-)) At first I'll join mp3's in QT, and
    than convert created track into AAC using iTunes.
    You can do that, but if you can do everything with QT, then why bother with iTunes?
    Another question - i don't want quicktime to show
    "Welcome Movie". So, i need to disable this feature
    or temporary turn it off. I tried use this:
    tell application "QuickTime Player"
    set show welcome movie automatically to false
    end tell
    But this not works. So, ... how?
    show welcome movie automatically is a read-only property, so you can not set it.
    You can disable it in QT's Preferences --> Show Content Guide automatically
    PS. That too bad that applescript application's
    library doesnot contain live examples.....
    No you don't want that. Things will get bloated.

  • Call AppleScript on file change ?

    Hi,
    is it possible somehow to start AppleScript when content of file change? (using FolderAction or whatever??)
    I'm using textedit (Coda) for HTML and PHP coding and I want to Safari reload page every time when I save file (hit Command+S).
    Q: is it possible to triger AppleScript when I save from some App or to detect that content of file is changed (due saving file from App)?
    Thank you in advance!
    Message was edited by: milankovach

    'Is it possible somehow to start AppleScript when content of file change?' - no.
    'using FolderAction ...' - no.
    '... or whatever??' - depending on 'whatever', most likely - not.
    'Q: is it possible to triger AppleScript when I save from some App or to detect that content of file is changed (due saving file from App)?' - no.
    Possible solutions:
    01. You can create an AppleScript applet (application) which constantly checks a known files' 'modification date', and act accordingly.
    02. You could use an utility application such as 'Butler' and via its 'Smart Item, AppleScript, AppleScript'' feature - assign a keyboard equivalent for 'TextEdit', 'Coda', or another editor application to save the contents of the applications' frontmost document, and then tell 'Safari' to open (and thus - reload) a respective web page.
    For example:
    Within 'Butler' a 'Smart Item, AppleScript, AppleScript' was created, and assigned '<control> <shift> c'.
    The associated starter Source Code is ...
    -- Code starts here --
    set tFile to (((path to desktop folder from user domain) as string) & "index.html")
    tell application "TextEdit"
    activate
    save document 1
    end tell
    tell application "Safari"
    activate
    open (tFile as alias)
    end tell
    -- Code ends here --
    Make sure to set 'Bulter's 'Triggers' tabs' 'Hot Key' 'Exceptions' popup button menu to 'Only'; add 'TextEdit', and / or what text editor(s) you use, to the textedit field beneath the just mentioned popup button; and actually assign a 'Hot Key' value - such as '<control> <shift> c'.
    The code is brief, crude, and works.
    You will have to refine the code so ...
    set tFile to (((path to desktop folder from user domain) as string) & "index.html")
    ... can be removed, and whatever document is the front most of 'TextEdit', 'Coda', etc. is saved, and then opened by 'Safari'.

  • Can't save files to Last Folder Used

    I'm scanning items with a Kodak iQsmart3, running under Kodak's oXYgen 2.6.1 scan application. Late last week, the application suddenly stopped saving files to the last folder used. Now I have to re-select the destination folder for each scan.
    I have rebooted the computer several times, and have also re-installed the scan application, but nothing helps the problem. It seems now that the problem may be with OS 10.4.11. I've searched and searched for a solution within the OS, but can't find anything that helps.
    Does anyone have a suggestion on how to proceed? Is there a place where you can check to see if the saving options can be changed?

    Thanks for your suggestion. However, I did as you advised and still cannot save files to the last folder used, as I used to be able to do.
    This is the first time in the 2 1/2 years I've been using this system that I've had any trouble with it. When I opened Disk Utility, it showed me the size and type of three different drives, all identical in manufacture. The first holds the Operating system, and the other two are set up in a Raid Striped set. I selected Macintosh HD under the name of the first drive, since that's the name of the disk on my desktop, and ran the Repair Permissions function, moving the recentitems.plist file to the desktop and rebooting, as per your instructions. Was that the proper area to use or should I have selected the disk description above that?
    (Below is the disk information from the Disk Utility application)
    Disk Description : Hitachi HDS725050KLA360 Media Total Capacity : 465.8 GB (500,107,862,016 Bytes)
    Connection Bus : Serial ATA 2 Write Status : Read/Write
    Connection Type : Internal S.M.A.R.T. Status : Verified
    Connection ID : "Bay 1" Partition Scheme : GUID Partition Table
    (Below is the information on the Macintosh HD folder of that drive.)
    Mount Point : / Capacity : 465.4 GB (499,763,888,128 Bytes)
    Format : Mac OS Extended (Journaled) Available : 226.2 GB (242,855,989,248 Bytes)
    Owners Enabled : Yes Used : 239.3 GB (256,907,898,880 Bytes)
    Number of Folders : 133,296 Number of Files : 684,567

  • I can't save files to my desktop, but I can save anywhere else. How do I fix this?

    I can't save files to my desktop.  I have no problem saving the same file anywhere else.  WHen I try through excel, for example, it tells me the file is read only. When I try to save it as a different file name, a pop up tells me I do not have permission to save to the desktop.  The same issue occurs when I attempt to take a screen shot (default save to desktop)

    Click on it, choose Get Info from the File menu, give yourself Read & Write access under Sharing and Permissions or Ownership and Permissions, and ensure it's not locked.
    (64371)

  • I can't save files to desktop in OS 10.8.2

    is there some reason I can't seem to use the finder to select the desktop to save files to? 

    So, after a couple of hours on the phone with tech support, turns out somehow the desktop folder was being treated as a document type and terminal was the default program to open it.  Never figured out why that could have happened, but had to create a new desktop folder and move all the items from the old desktop into it.  So for the time being the problem is gone.

  • "Always ask me where to save files" does not work.

    Summary: The "Always ask me where to save files" feature does not work. No dialog box comes up, apparently because the browser is stuck on a bad old read-only lastDir location, in a prefs.js file that I can't edit.
    Details:
    I am using Firefox 30.0 on Mac OS 10.6.8. My Mac has a both a read/write Mac partition that I use most of the time, and a bootcamp Windows partition drive ("C"), which I can read but not write to.
    At some point I accidentally tried to download a file from a site, using Firefox, to the read-only Windows C drive. Ever since that time, I have not been able to download any files from Firefox, except to the firefox/downloads folder. This is inconvenient. If, in preferences, I try to set downloads to ""Always ask me where to save files", the dialog box does not come up when I actually try to save files. This problem does not apply to saving photos by right-clicking them.
    If I open, in text-edit, mozilla/firefox/profiles/t4vockvue.default/prefs.js, which was saved yesterday, I can see a problematic line. It reads:
    user_pref("browser.download.lastDir", "C:\\Documents and Settings\\[etcetc]");
    C:\\Documents and Settings\\[etcetc] being the read-only windows directory.
    This prefs.js is apparently not an editable file.
    I tried to fix this by opening a browser tab in Firefox and opening about:config. The editable browser.download.lastDir does NOT show the same "lastDir"....it shows some directory that I successfully downloaded photos to, by right-clicking on a photo.
    How can I fix this problem?
    Thanks.

    To confirm which profile folder is active when you are running Firefox, it is easiest to open it from inside Firefox as follows:
    Sometimes the file that stores the customizations becomes corrupted and fails to update properly at the end of your session. You can rename the file and customize from scratch.
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    In the first table on the page, click the "Show in Finder" button (Windows: "Show Folder" button).
    Hopefully you are using a separate profile folder on each OS.

  • Re Time Machine "You do not have appropriate access privileges to save file ".002332b7be8a" warning preventing backups--this may help temporarily

    My TM is often giving me the "You do not have appropriate access privileges to save file “.002332b7be8a” in folder “Time Machine Backups”" message when I go to select my backup drive. I've reviewed past archived discussions on this and, like many other people, gotten completely flummoxed trying to find a permanent solution.  Tried the suggested fixes via Terminal and it didn't help because I couldn't get through the entire process without Terminal telling me it couldn't find a file or drive.  When I can find the time, I'm going to try Tinker Tool to reveal where that numbered file actually is and give it another go.
    In the meantime, for those who are desperate to get their TM working again to get at least one backup done, I can offer people a temporary solution that's worked for me.
    I've found that restarting my iMac somehow resets TM and usually allows it to do at least one of its automatic backups, sometimes several, before it reverts back to failing and producing that same darn warning message.  I only want a backup done once a day, so it's not that inconvenient to go this route.
    There's another even quicker  method (perhaps a little more risky but hasn't been a problem for me yet) that I've been using more recently, and that is to simply unplug the external while the iMac is on (I close system preferences first though, and make sure TM isn't actually doing anything at the time) then plugging it back in and choosing the backup drive again in the TM system preferences window once that drive has shown up again in the Mac's list of devices.  I don't get that warning message when I do this.  It works every time for me and so far it hasn't lost or corrupted any data on the external, despite the warning message you get on Macs when you unplug a USB device without ejecting it first.  However, do this at your own risk--don't flame me if it backfires on you.  If you're of the opinion that it's not wise to unplug the device this way, then fine, go ahead and state such in this thread, but be polite about it.
    Hope this helps anyone who's frantic to make a backup without having to start from square one with a whole new complete initial backup (can take many hours to make one) on a fresh external drive.
    By the way, I've read somewhere that this problem was fixed with Snow Leopard.  Whether that's true is another matter.  I'm not quite ready to update to 10.6 for other reasons, even though I bought it, and I figure some other people are also still using 10.5.8 out of fear and loathing around the unknowns of installing a new OS too, so that's why I thought I'd post this message (couldn't find a discussion around this that was still active and not archived).

    noodlenose wrote:
    My TM is often giving me the "You do not have appropriate access privileges to save file “.002332b7be8a” in folder “Time Machine Backups”" message when I go to select my backup drive.
    Wow, I haven't seen that in a looooong time!
    Tried the suggested fixes via Terminal and it didn't help because I couldn't get through the entire process without Terminal telling me it couldn't find a file or drive.
    Do you mean in #C5 of Time Machine - Troubleshooting?
    When I can find the time, I'm going to try Tinker Tool to reveal where that numbered file actually is and give it another go.
    It should be at the top level of the drive.
    By the way, I've read somewhere that this problem was fixed with Snow Leopard.
    Yes.  I'm not sure if it was 10.6.0 or one of the early updates, but I haven't seen any reports of this in quite a while.

  • I cannot print from Websites or my college online course. Tries to save files to desktop as an .xps document but nothing happens and I get an error message that print command did not work. Have reinstalled firefox and adobe, no help. Any suggestions?

    Cannot print anything from internet using Firefox as browser. Please advise. I have to use Firefox for internet college courses, cannot print my assignments. I do not have this problem on Mac or using Internet Explorer. Only happens when using Firefox. When I select print a message comes up to save information to desktop as .xps file. Select save, sometimes it is on the desktop but I cannot open the file or it simply does not save file and get an error message that print command failed. What is happening?

    {Ctrl + P} and select your printer in the Printer - Name box near the top of that window.
    http://kb.mozillazine.org/Problems_printing_web_pages

  • Microsoft Office 2004 (Word) unable to save files  I have been running Office 2004 on my Intel iMac with Snow Leopard for some time and all of a sudden I cannot save a document. Word just stopped responding and I have to force quit. I can open Word and cr

    Microsoft Office 2004 (Word) unable to save files
    I have been running Office 2004 on my Intel iMac with Snow Leopard for some time and all of a sudden I cannot save a document. Word just stopped responding and I have to force quit. I can open Word and create a new document but I cannot save it. I reinstalled Word but that didn’t help. Then went to the Internet and found at least one other Mac user having the same problem which it suggests is caused by a recent Mac Security Update:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2004-macword/word-2004-wil l-not-open-or-save-documents/b04eb870-9b0d-4f3b-bb47-b122301e36f6
    So I check for a new Mac Security Update and sure enough there was one. I downloaded it and now Word seems to be working, as it should. I can both open and save files. The only problem remaining is that when I open Word I get the following error message “An unexpected error occurred while trying to load the Microsoft Framework library”. I contacted Apple but they were unable to help.
    How can I get rid of this error message?

    Look, I realize you might have to get your machine working, so this is how you revert back.
    Restore proceedure to pre-Security Update 2012-001 v 1.0 & v 1.1
    #1 Backup your personal data off the machine.
    Backup files off the computer (not to TimeMachine). If you don't have a external drive, get one and connect to the USB/Firewire port and simply drag and drop copy your User folder to the external drive, it will copy all your files. It's best to have two backups of your data off the machine when trying to restore.
    Disconnect all drives now to prevent any mistakes from occuring.
    #2 Reinstall OS X 10.6 from disk
    Get out your 10.6 install disk and make sure it's clean and polished (very soft cloth and a bit of rubbing alcohol, no scratches) If your disk is borked, you'll have to order a new one from Apple with your serial number.
    Hold c boot off the 10.6 disk (wired keyboard, internal optical drive), use Disk Utility First Aid to >Repair Disk  of your internal drive  (do not format or erase!!), Quit DU and simply re-install 10.6.
    Note: Simply reinstalling 10.6 version from disk (without erasing the drive) only replaces 10.6.8 with 10.6.x and bundled Apple programs, won't touch your files (backup anyway)  or most programs, unless they installed a kext file into OS X itself. (only a few on average do this)
    #3 Update to 10.6.8 without Security Update 2012-001 v1.0 or v1.1
    Reboot and log in, update to 10.6.8 via Software Update, but EXCLUDE THE Security Update 2012-001 by checkinig the details and unchecking the blue check box.
    #4 Reinstall any non-working third party programs
    When you reboot, make sure to reinstall any programs that require kext files installed into OS X, you'll know, they won't work when you launch them or hang for some reason as they are missing the part they installed into OS X.
    If for some freakish reason you get gray screen at any time when booting (possible it might occur when you reinstall older programs), hold the shift key down while booting (Safe Mode, disables kext files) and update your installed third party software so it's compatible with 10.6.8.
    https://support.apple.com/kb/TS2570
    That's it really.

  • I deleted my download folder and now I can't download anything. I can't select the folder to "save file to" and when I select "ask me where to save files" I still can't download. it says your file will start downloading, but then it doesn't. Help!!

    I deleted the folder that saves everything that is downloaded from Firefox. After that I can't download anymore. I've tried clearing my download history, reset the download folder, reset the download action by renaming the mimetype.rdfs file and it's still not working. I've tried to choose a different download folder but it doesn't let me select any folder at all. If I select "ask me where to save files" and then try and download something, the download doesn't start after I select save to. The only time it does actually download is when I select "open with...windows mediaplayer" when downloading then the download will start. Please help. Thank you.

    You broke your phone by getting it wet.  Nothing more to say.  Bring it in to Apple for an out of warranty exchange or buy a new phone.  There's really nothing else we users here can help you with.

  • How to open and save file like the Notepad Demo do?

    I am a newer to Java Web Start. I found that in the Notepad Demo, when user try to open or save file, a message box appear and give the user some security suggestions.
    In my application, I used a JFileChooser and set the <security> element to <j2ee-application-client-permissions/> in the jnlp file. But the application will thow an exception:
    access denied (java.io.FilePermission C:\Documents and Settings\Administrator\desktop\Java Web Start.lnk read)
    Can someone tell me how to solve this problem. By the way, where can I find the source of the Notepad Demo. I want my application to open and save file just like the Notepad Demo do.

    The Notpad demo uses the JNLP api to read and write files. The api doc can be found at:
    http://java.sun.com/products/javawebstart/docs/javadoc/index.html
    Although the Notpad demo source is not available, there is other sample code available at:
    http://developer.java.sun.com/developer/releases/javawebstart/
    Included here is the webpad demo, which uses the FileOpenService and
    FileSaveService API's.

Maybe you are looking for

  • T430 freezes on 1080p HDMI connection

    HI, My T430 was wokring perfectly, I got the NVS5400M card(Nvidia optimus) with intel hd4000. Drivers version: Intel - 9.17.10.2843 nvidia 9.18.13.1269 which is the latest from lenovo Lately, I got a 1080p monitor. it is connected to the mini display

  • How ca i search a particular word in mail

    can anybody please tell me how to search a particular word in mail Please mention the coding

  • ITunes 10.4 crashes at startup, using OS X Lion. Help!

    Hi: iTunes crashes at start. It appears a window with information in spanish that says that iTunes isn't compatible with this version of Mac OS X. I have all up to date. I reinstaled 10.4 and even instaled 10.3 version, wich is the one that I have in

  • Clicking on a text and displaying its components

    Hi, I'm new here, and I'm a newbie in Java coding lol so I don't really know my way around What good code can do the following? Click on a Button -> Generates a Text in textArea -> Click on the line of the generated text in the textArea -> Displays c

  • Restore catalogu nightmare

    Nightmare trying to restore catalog with >40,000 items on new computer. I am running PSE 12 on a PC with Windows 7. I have just replaced two disks on my old PC and am trying to restore my latest catalog. When I ask it to restore to the original locat