Scripting Applescript Editor and saving files

I've created an Applescript that generates a smaller, simpler script.  I've gotten everything to work, but when I tell Applescript Editor to save the file, it doesn't work.  It doesn't error out, it acts like it finished properly, but nothing shows up in the location I told it to save.  Here's the snippet that's giving me problems:
tell application "AppleScript Editor"
activate
make new document
set contents of document 1 to fnlScrpt
compile document 1
save document 1 in "Macintosh HD:" as "application"
close document 1 without saving
end tell
I'm going to define a more specific save location once I get it working, but for now it just saves to the top level.  It needs to save as an application, and close the script without saving it.  Any help is appreciated!

Hi all,  I'm a little late to this thread in an attempt to get some scripts working in Lion.    Thanks for the help.  I noticed the way you set your globals, and the way you're having variables get passed on to recompiled scripts.  
I take a different approach,  by writing my Applescript as text,  in quotation marks,  and then relying on fields getting filled in when the Applescript Editor is run, and the new script has the correct data.      I make one text entry called "QT_multiliner" and fill in variables using quotation marks and ampersands. 
THIS FIRST SCRIPT is used to take variables given to it by a database,  and generate a custom applescript for any given record in the database.  
set yyyymmdd to (((year of (current date)) * 10000) + ((month of (current date)) * 100) + (day of (current date))) as text
set mmdd to (text items 5 through 8 of (yyyymmdd)) as text
set qtPath to "/path/to/folder/" & mmdd & "/"
set RenderPrefix to "filename_of_choice"
set TGA_path to "/path/to/folder_with_files/" & mmdd & "/" & RenderPrefix & "/" as text
set appletPath to "/path/to/folder/applet_name_" & RenderPrefix & ".app"
set temp_doc to POSIX file appletPath
--write the applet in Script Editor.  Variables will be filled in and compiled in Script Editor.
set QT_multiliner to "tell application \"Finder\"
set thePath to \"" & TGA_path & "\" as string
activate
make new Finder window
set target of Finder window 1 to (POSIX file thePath)
set theSequence to get first file of the front window as alias
close window 1
end tell
set sequenceName to \"" & RenderPrefix & ".mov\"
tell application id \"com.apple.quicktimeplayer\"
          activate
          open image sequence  theSequence  frames per second 23.98
          set savePath to \"" & qtPath & "/\" & sequenceName
          tell movie 1
                         with timeout of 2400 seconds
                                        export to  (POSIX file savePath) as QuickTime movie using settings alias \"path:to:settings:file\"
                         end timeout
                         close saving no
          end tell
          quit
end tell"
-- Write the script to its own applet 
tell application id "com.apple.ScriptEditor2"
          set x to make new document
          set x to the front document
          set the text of document 1 to QT_multiliner
  compile document 1
          save document 1 as "application" in (temp_doc)
  quit
end tell
...now,  when that is run,  the following applescript is generated with all of the variables filled in. 
--This applet was saved by the previous script, and is saved as /path/to/folder/applet_name_filename_of_choice.app
tell application "Finder"
          set thePath to "/path/to/folder_with_files/0112/filename_of_choice/" as string
  activate
  make new Finder window
          set target of Finder window 1 to (POSIX file thePath)
          set theSequence to get first file of the front window as alias
  close window 1
end tell
set sequenceName to "filename_of_choice.mov"
tell application id "com.apple.quicktimeplayer"
  activate
  open image sequence theSequence frames per second 23.98
          set savePath to "/path/to/folder/0112//" & sequenceName
          tell document 1
                         with timeout of 2400 seconds
                                        export to (POSIX file savePath) as QuickTime movie using settings alias "path:to:settings:file"
                         end timeout
      close saving no
          end tell
  quit
end tell
I really liked Camelot's "script / end script" function,  it's better,  but I just couldn't get it to pipe variables through from one script to another.     Since I need to run this script on any one of dozens of computers,  I need the variables to be compiled and saved within each applet. 
all the best,
Vic

Similar Messages

  • Problem occurring when opening and saving files in AI SC5 with Windows 7

    Hi, I ‘am a Graphic Designer and first time working in UAE Windows 7 is basically the only OS here. My PC is:
    HP Elite 7000
    Intel® Core™ i5 CPU 2.67GHz
    4GB RAM
    32-bit
    Now to the problem, not that knowledgeable in IT stuff so here goes:
    1. Problem occurring when opening and saving files in AI SC5 with Windows 7. (You will actually see a “Not Responding” word coming out while opening and saving files, whether small or large files)
    2. Locked layers occasionally are moved accidentally.(Working on multiple layers is normal so we need to lock it specially the once on top. But there are times I still manage to select locked layers)
    3. After typing and locking the text, pressing “V” for the arrow key shortcut is still added to the text that is locked. (After typing I lock the text layer with my mouse and Press “V” to activate the arrow key… yes the arrow key is activated but the text is still typing the actual keyboard pressed)
    I’ve only use the brand new PC and installer for a month now. Not sure if this is compatibility issues or something else I’m not aware of.
    Thanks in advance to people that will reply.
    Cheers!!!

    Well I’m still wondering if it is compatibility issues because I’m also having problem with Photoshop CS5. These 3 are all bought at the same time (PC, Illustrator and Photoshop installers). The problem I’m having in Photoshop is not that too important, every time I Ctrl+O to view files, all PSD are shown in white paper like icons, no preview, and saving as well.
    Or I just purchased a corrupted or pirated installers… Adobe updates are done every time I’m prompted.

  • CS3 crashes when Opening and saving files - also runs slow

    Today, while using photoshop, it locked up on me & I had to force quit. It then wouldn't open a file either via Bridge or the open menu. I could create a new file, but it would hang while attempting to save.
    I downloaded and ran the FixVCUIFramework, and it allowed me to open and save 1 file, before it started not saving or opening again. Running the Fix again has no effect.
    I switched to another user account, and everything works fine - in fact PS runs much speedier in the 2nd user account than in my main account. I hadn't noticed how slow it had become in opening and saving.
    Any ideas of where to look in trying to repair my main account? I don't want to have to migrate everything over to the 2nd account. Bridge in the 2nd account doesn't allow me to open all my folders, so I'd prefer not to work totally with a new user account.
    PSCS3 10.0.1
    Mac 2GHZ dual 4.5 gig ram
    10 gig external scratch disk - PS running at 71%
    Mac OS X.4.11
    A day without Photoshop is like a day without sunshine ...
    Thanks

    A forced quit WILL create corruption.
    An Archive and Install of the OS will give you a fresh system in your regular account while preserving your settings. Should take you less than 45 minutes.
    But you may want to try deleting your Photoshop preferences and running the 10.4.11 update over your existing 10.4.11 system first. That may work too, and it would be faster.

  • Office 2013 applications cannot be made to show the "Documents" folder when opening and saving files

    (Windows Server 2012R2 and Windows 8.1 PRO)
    We are redirecting the user's "Documents" folder to the network (using Folder Redirection). The OS hides this fact however, and most applications simply see the "Documents" folder when opening or saving files, including Office 2003.
    Office 2013 however displays the actual path, which in this case is:
    \\sever1\redirect$\username\documents
    Even if you forcibly set the "Default local file location:"  in the Options Save area to the 'Documents' folder in, say, Word, Word immediately converts the local path to the network path.
    Is there anyway to get Office 2013 to follow the virtual path? All of other apps follow it and expose the users only to "Documents".
    Thank you so much.
    Dana

    There's nothing in my FAQ concerning screen savers, so I'm unsure why you decided to take that approach. From your description, it looks like you only tried a few of the suggestions before throwing in the towel. That's fine, it's your call.
    I don't have the problems you described with 10.4.7. Usually when folks have problems after an update, these are caused by either installing an update on an already-corrutped system or they've installed third-party applications or hardware that have been rendered incompatible by the update.
    Before installing software updates, you may wish to consider the advice in my "Installing Software Updates" FAQ. Taking the steps therein before installing an update often helps avert problems and gives you a fallback position in case trouble arises.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • How do I proceed with installation of PE_13 7z from a downloaded and saved file?

    I downloaded and saved PhotoshopElements_13_LS25_wind64.7z file using the provided dowload manager.
    The download manager did not provide instructions to install the software.
    What is my next step?
    RH

    It seems you have a zip file do you have a unzip file as well ?

  • Script to install and enable file and printer sharing windows 7

    Hello
    I posted this question on the Microsoft Partner Windows 7 forum and the support person told me that I should post it here.
    I have a Customer that was running Novell.  We will migrate them to Active Directory.
    The question I have is.  they did remove the file and printer sharing service on their Windows 7 workstations.
    Is is possible to have a command line or a script to install and enable the file and printer sharing for Microsoft Network?
    We need this enable in order to install the SCCM client remotely
    Greetings
    Gaetan Labrecque

    How are you going to connect to the workstations?
    File and print sharing are not needed for Group Policy to work.  GP can be used to re-enable file and Print Sharing.
    You will also  need to start by joining the machines to the domain.  That will be very difficult unless all have PowerShell and are configured for WinRM.
    This can be somewhat accomplished by using VBScript remotely but will require a very sophisticated admin to set up and debug in your environment.  I recommend hiring a consultant who has experience in conversions or is a master VBScripter in a domain.
    There is no easy answer.  It is not about File Sharing.
    Here is how to add roles and features with PowerShell:
    http://technet.microsoft.com/en-us/library/hh831809.aspx
    ¯\_(ツ)_/¯

  • Problem with parameters to fix opening of old tabs and saving files when a new session is open

    Hello,
    Since 2 weeks I have a problem: I always fix my parameters to restore previous session with all my tabs and I choose that Firefox asks me where I want to save my downloaded files. Now each time I close Firefox and I reopen it, it is not taken into account, and 3 tabs are opened: Firefox, Google and Thank to install Zotero! I rechange it, but every time it opens these tabs and not my old tabs. The same for saving files. It goes back automatically to open start page and to save my file in Downloads. Even if I rechange, it comes back the same.
    I desinstalled CCleaner (I thought it could be that) but nothing changes!
    Please help. Thank you very much!
    Martha

    Here's what I would try:
    *Reset Firefox - this should fix the issue but it will change settings like where files are downloaded and what tabs open at startup back to their defaults.
    *Then change your download and session restore preferences back to how you like them.
    Here's how:
    #Go to Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    #Open the options window - Tools > Options > General
    #In the General panel set Firefox to open your tabs from last time and set Firefox to ask you where to save downloads.
    #Click OK
    That should do it. Let me know if this worked.
    Thanks,<br>
    Michael

  • Open and saving files???

    When I try to open or save files, the pop up window wont display the existing files already on that folder. What is the problem?

    My apologies, it's not blue any more (it used to be), it's now white/grey (in 10.8). When you're in an application and click File - Save, or cmd-S, you should see the Save window, with the filename in the middle. The triangle is to the right of the filename. If the window is small, the triangle will be pointing downwards. Click it, and the window will expand and the triangle will point upwards.
    Note that, if you have iCloud Documents enabled, you may see "iCloud" under the filename. If that's the case, you're not actually looking at your computer, you're looking at your iCloud space and the expansion triangle won't work. Click "iCloud" to change to a location on your computer and the expansion triangle will be enabled.
    Matt

  • AppleScript open and save file with Numbers

    Hi all,
    I need to save an Excel .xls file as an .xls file in order to break the links that are included in the original Excel file. Since Numbers doesn't have any actions for Automator, I hoped someone could help me writing an AppleScript?
    It needs to open (Numbers) and all the .xls files that are added to a specific folder on my Mac, then save them to another folder as .xls (not .xlsx) and overwrite any existing files with same name. Since this all should work automatically, warnings and pop-ups that need a user to click an option are not allowed.
    Didn't think this could be too hard, but I'm just a noob when it comes to AppleScript. Help?
    Thanks in advance

    Check the attributes of the <textarea> tag. You can use wrap="no" or wrap="virtual" or wrap="hard" to define how the text area handles carriage returns.
    Brian

  • Can i back up my photos and saved files/ music using icloud?

    i don't have an external hard drive right now to back up my files before i upgrade to os x snow leopard.. i know i'm behind... so if anybody could help that would be great!!

    If you are upgrading TO snow leopard, then whichever version of OSX you are currently using, it is not compatible with icloud.  And besides, a mac cannot back up photos and music to icloud.  Few file formats can be saved there as well.  icloud is not your solution.
    If you are not using Time Machine to store backups to an external drive, then I don't know what to say.  You can't use Dropbox since it requires the files to be stored locally as well as in their cloud.  You have to get an external drive, smaller sizes are not that expensive.

  • Shell script for moving and renaming files

    I'm not so familiar with shell scripts. I have created some simple scripts for various tasks but now I hit something I can't handle myself.
    My server receives every night a logfile from another server. This file I need to rename and move to another location. Problem is that a simple mv with new filename isn't enough, I need to insert date in filename. Format for date should be ddmmyy. Also the name of incoming file changes every night. The output always starts with same letters, let's say "log", and the date is used to identify files.
    For example I receive a file /Input/filename.log and I need to move the file to the folder /Output with name log130308.txt.
    Any tips how to insert the date as part of of filename while renaming or moving the file? I prefer shell script as I'll use launchd for scheduling the script.

    Hi again,
    so far I've constructed this:
    cd /input
    for file in `ls *log`
    do
    echo "Copying " $file
    cp $file /output/log.$file.`date +%d%m%y`
    done
    Quite there. I'm cding to directory, i'll focus later how to set some environmental parameters.
    Problem with zipping is that I don't know exact logfiles names. Each day there's a new name. So zip -q filename.zip filename.log isn't quite enough and it's impossible to use wildcards. The switch -q and checksums were welcome suggestions.
    Thanks again,
    Juha
    Message was edited by: J.Otava

  • Creating and Saving File Links

    Hi, been searching the forums and internet for my answer but can't seem to find the answer.  I have a PDF that I am creating links to other PDFs on an FTP server.  When users clicks on the link, the files automatically open in the reader.  Since the files are pretty big, I would like the users to have the option to either save the file or open the file (that way they don't have to wait for the file to download before saving).  Right clicking on the link does not give me the option to save the file.  Is this a setting I need to use when creating the links to give the option to save or is there another keyboard command?  Thanks for any assistance.  I am using Acrobat Pro 8.1.3
    JT

    G'day JT,
    When using Acrobat 8 Professional -
    The right click context menu associated with an Acrobat web link contains:
    --| Open Weblink in Browser
    --| Append to Document
    --| Open Weblink as a New Document
    --| Copy Link Location
    Adobe Reader does not provide this.
    So, what is available will be a function of what the end-user has.
    For either Adobe Reader or Acrobat.
    Edit > Preferences > select the Category "Internet"
    In the Web Browser Options pane "Display PDF in browser" can be selected (default) or can be unticked.
    Selected => A PDF in web space is displayed in the browser.
    Unticked => A PDF in web space is downloaded and rendered by the PDF viewer identified to the OS.
    But, this is a User controlled setting.
    Looking about, you may come across "app.launchURL()".
    To quote from a post by Thom Parker over at the Acrobat User Community,
    "In Acrobat 7 the "app.launchURL()" function was added to the Acrobat JavaScript model. 
    This function has an input argument for forcing the web page to open in a new window. 
    If your users are on a later version it will work for them.  Look it up in the Acrobat JavaScript Reference."
    However, this would still open the target PDF - there'd be no "save target as..."
    It might be that to have a "save target as..." option you may have to provide an HTML file with links to the PDFs.
    Be well...

  • Closing and Saving Files

    I'm new to Photoshop.  In preparing photos imported from iphoto for a book, I've learned how to change the ppi and format, but when I try to move on I find I don't know how to save and close out of editing a photo.  The photos either have red "edit in progress" bands, or multiple copies, or both. 
    I don't know where to save them, either.
    Thank you.
    Laurel Galli

    When you say "book" does it means "photo book"?
    getting out of photo book(or any other creation workflow) is as easy as saving your creation and then clicking close.
    This is actually for all the workflows. If you have an image opened in PSE Editor, even if you are not working on it, it would be shows with "edit in progress" in the organizer

  • Unistall and saving files

    how do I unistall macromedia fireworks mx2004 and save my files i downloaded using fireorks  I tried  catching it and chaning it but missed some is their anyay at all to save the file I make tags (sig tags) for folks I am having a hard time finding the tag i made to use  I dont want to have to remake them

    Hi,
    According to the error message "unable to save", I find some reference and address them here.
    https://support.microsoft.com/kb/271513/en-us
    http://community.spiceworks.com/topic/371563-excel-document-not-saved-issue
    Hope it can be helpful.
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Theme Editor  and CSS files

    Hi all,
    NetWeaver Portal 2004 SP16
    For those of you who have worked with the Theme Editor probably feel the same way as I do: it's just not good enough. It allows you to change some styles but really for real changes one has to edit the million stylesheets manually.
    When going down that road, the Theme Editor becomes useless because it overwrites your manually applied changes.
    As long as you reapply your changes afterwards, this works pretty good but I'm still confused about one thing. The stylesheets that are actually called from the webpage are followed by some sort of counter. For example:
    ../prtl_std/prtl_std_ie6.css?6.0.16.0.31 The last number increases everytime you save a theme in the Theme Editor, so it acts as a version numner (see themeInfo.properties).
    And now the annoying part: this <u>sometimes</u> prevents my manual changes to be read (one can check this by inspecting the css files in browser cache).
    My question: what does this counter do? Are themes also stored in the PCD / database and if so where? What can be done to have the portal ALWAYS push the css files from the irj/portalapps/com.sap.portal.design.portaldesigndata/themes/portal directory?
    Cheers
    Marcel

    The counter works with the database. It is actually possible to edit other (no visible) style sheet classes via the Theme Editor

Maybe you are looking for

  • How to increase disk size in solaris

    Hi all I have two disk c1t0d0s0 / c1t0d0s7 I do haven't space in disk /dev/dsk/c1t0d0s0 run df -h /dev/dsk/*c1t0d0s0* 8,8G 7,4G 1,3G 86% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/

  • Loading Adobe Photoshop on my MacBook Air (2014) without an optical drive

    My lab at the University already has Adobe Photoshop. I am wondering how do I download it on my new MacBook Air (2014) without an optical drive. Another query is about the usability of photoshop on MacBook Air. Mine is a 1.4Ghz, 128gb, 8mb (RAM) MAB.

  • Some CS4 Raw adjustments lost after save to jpg or tiff

    I've been running Photoshop CS4 under Windows XP 64 bit  (with 8Gb RAM) with no problems whatsoever (including use of GPU feature) since November 2008. Very recently, with a difficult  event photosession I have a bunch of photos that have are overexp

  • File Port Not Picking Up File

    Hello All, I'm trying to get a file sent from an external system to SAP. I created a file port. The inbound tab of the port has the full path of where the file will be after it's sent from the external system. The external system is a PC server and i

  • Problem with a TV episode

    ok so I Downloaded Heroes Episode "Cold Wars" and it stops 10 mins before the end? i Reported the problem but all i got was an email back saying you cant have a refund?? I don't want a refund i want to redownload the episode i payed for as its not co