Execute Automator Workflow from AppleScript

I have a need to execute an Automator workflow from an AppleScript.
In 10.4, this would work:
set myWorkflow to "path:to:workflow"
tell application "Automator Launcher" to open myWorkflow
In 10.5, it does not. Is there an alternative way to do this in 10.5?

Hi Dan!
Copy the (Tiger) Automator Launcher.app 1.0.4 (*) somewhere to your 10.5 system and modify your AppleScript like this:
tell app "path:to:Automator Launcher.app(1.0.4):"
open "path:to:automator workflow:"
end tell
(*) /System/Library/CoreServices/Automator Launcher.app
Message was edited by: spazek

Similar Messages

  • How to execute a workflow from a webdynpro application???

    hi friends....
    How to execute a workflow from a webdynpro application???
    we are using ep6, ecc5????

    If you want to start a workflow in the backend, you need to call a RFC that starts it.

  • Accessing Automator workflow from *within* iPhoto

    I have quite a few Automator workflows that I’d like to apply to a number of selected images right within iPhoto’s main window.
    Is there any other way than the usual export/re-import?

    Using that Automator workflow will add another layer of jpeg compression to the file and reduce it a fair amount. There's an applescript that will convert to sRGB without reducing the file size. You can download it from Toad's Cellar. It will convert all files within an folder that's dropped onto it. If the file reduction isn't of concern to you then use the Automator workflow. I have one on Toad's Cellar that will add the sRGB profile to all files within a folder and its subfolders. You could do the entire Originals folder in the library in one pass that way. You can download it and see if it differers from you workflow in any significant manner.
    NOTE: Neither of the two above will work with grayscale files. There is one that will convert files to jpg, RGB mode, and embed the profile available at Toad's Cellar, however.
    I may be preaching to the choir here but here's some tips on using PS with and within iPhoto:
    Using Photoshop (or Photoshop Elements) as Your Editor of Choice in iPhoto.
    1 - select Photoshop as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    NOTE: With Photoshop Elements 6 the Saving File preferences should be configured: "On First Save: Save Over Current File". Also I suggest the Maximize PSD File Compatabilty be set to Always.
    If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and seledt "Edit in external editor" in the Contextual menu). This way you get the best of both worlds
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    Message was edited by: Old Toad

  • Automator Workflow returns Applescript Error.

    I recently created an automator workflow that will allow me to play an internet radio station without opening a browser. The workflow is…
    • Get Specified URL's (with the radio station's live streaming URL)
    • Website Popup (displays a window that plays the radio station)
    Simple enough. And it worked fine.
    So I thought, let's make this more useful. Let's add a second URL to the "Get Specified URL's" action, and options "Show this action when the workflow runs." Then I can select the radio station I want to listen to from the list.
    Now, when I run the workflow, I get the list of URL's to select from. When I click to select one, I get an "Applescript Error. AppleEvent Handler Failed -10000. That's the whole message. Nothing else.
    Now, this still works. When I click "OK" the workflow continues, brings up my popup window, and plays my radio station. But it's just an annoyance to have that AppleScript Error message pop up. Even more strange, (IMO) is that fact that if I leave both radio stations selected, there is no AppleScript Error, and my workflow defaults to the first radio station.
    BTW, the workflow is only these two automator actions. I did not add any Applescript of my own. And it's definitely the first action that's generating this message. It's the "click" that generates that message.
    Any ideas?

    Actually, I was referring to it's use in this case, since you are only going to select one item from the list - it isn't set up very well for selecting individual items. The resulting list should really be limited to one item, since allowing multiple selections might get interesting, but there isn't a handy way to do that. Using "Open URL" isn't a very good option either, since it leaves the workflow running.
    The error seems to be related to the checkboxes, so you might try an end run by using the *Choose from List* action, which doesn't have the problem:
    1) *Get Specified URLs* -- don't show the action when run
    2) *Choose from List* -- make the selection here
    3) *DIsplay Webpages*

  • Execution of automator workflow problem

    I'm trying to execute an Automator workflow from an applescript, but the specific command won't work:
    <pre>
    set theScript to "path:to:the:script"
    tell application "Automator"
    activate
    execute theScript
    end tell
    </pre>
    For some reason, the command execute theScript just does nothing. I've verified that I've got the path right by substituting open theScript in its place successfully. It seems that the command execute is not working as described in the Automator 2.0 Applescript dictionary.
    Am I doing something wrong here? Or is this a bug in the Automator 2.0 Applescript dictionary?

    While I haven't answered my original question, I have found a workaround for calling an Automator 2.0 workflow from Applescript. Instead of saving the workflow as a workflow, you save it as an application and then open the application in finder. The code goes like this:
    <pre>
    set lf to path to library folder from user domain
    tell application "Finder" to open (alias (lf & "Scripts:foo.app:" as text))
    </pre>
    I found this at macosxhints.com; http://www.macosxhints.com/article.php?story=20071123181555282
    I still haven't found what was wrong with calling the workflow as a workflow using the commands in the Automator Applescript dictionary.

  • How to apply multiple automator workflows to one file

    Hi everyone,
    I've set up a few workflow applications to automate the process of making packshots from PDF files. The way those roughly work is they create a temporary copy in a folder, open a Photoshop droplet that executes all the actions on the file, and then save the finished product in a "finished" folder.
    However, we frequently need to deliver multiple packshots made from the same file. I was asked to make one automator app that allowed us to drop the PDF version on it, resulting in the multiple types of packshots in the "finished" folder, together with the original PDF.
    The way I have this set up right now is as follows:
    1) Copy the original PDF file to the "finished" folder
    2) Execute the first automator app
    3) Execute the second automator app
    This seems simple enough, and does work in 10.6.8. When I try it on a different computer in our studio though, with 10.7 installed, I get various errors:
    - Sometimes it says an error occured within one of the automator apps, while the app works fine when running it seperately (on all computers).
    - Sometimes it says something like "An error occurred while converting the data" when moving on from the first application to the second application
    - Sometimes I'll get an error message in the log, saying:
    *** -[_NSArrayl objectAtIndex:]: index 0 beyond bounds for empty array
    What I got from this is that it's actually not getting the right input it requires (or not getting any input, since it's an empty array). However, the previous task is set to "return the task input" (our systems are Dutch so excuse me for any discrepancies in translations please), and the resulting output that I get seems to be what I want the next automator application to use. Below is a screenshot of the error message:
    What I've tried:
    - I read somewhere that the newer versions of Automator require the action "Retrieve selected finder items" between them. I've tried using this in various ways (between all other actions/tasks, only before the second application to be run and before both applications to be run), but with no success. The problem I have with these is that, during the applications, it moves the files around, thus apparently selecting those folders as well.
    - Building an entirely new workflow on the newer system
    - Using "Start application" instead of "Execute Automator workflow". This results in Automator saying that it did execute the workflow while nothing happened.
    - Using "Ignore input" for the second application. This also results in Automator saying that it executed the workflow while nothing happened.
    So right now, I'm pretty stumped as to how to get this combination of apps to work in 10.7. Any solutions or workarounds are most welcome.
    Thanks in advance!

    Yes, angelanna. You can merge or split your video file via FCP sequence.
    ahaah, maybe I think angelanna would like to get the resulting file with MTS format because he mentioned “No need to be compressed”. Are you asking for this, angelanna?
    If so, a simple MTS files managing and editing tool  is needed. Maybe you can have a try the Mac version of Aunsoft Final Mate for managing HD camcorder footages. I just downloaded its free trial version and it offers a simple way of garping footages directly  from camcorder. And also it provides a attractive feature to join flawlessly and split accurately native MTS files for video file output with original MTS format.
    Maybe this is the tool cwhich an help you out, angelanna.
    Enjoy your video.

  • AppleScript error -609 in Automator workflow

    I created an AppleScript on one computer and incorporated it in an Automator workflow. The script works perfectly well stand-alone or as part of the workflow.
    Then I copied both files to a headless computer via VNC. I adjusted the workflow to look at the new location of the script, and the script itself to look at the new location of the file it's processing. Now, on that second computer, the script works perfectly well by itself, but I get AppleScript error -609 Connection Is Invalid if it's run from the workflow.
    For testing purposes I reduced the script to its simplest expression:
    tell application "Finder"
    end tell
    and it's still generating the error.
    Strangely, from the workflow the full script does what's it's supposed to, but the workflow stops because of the error. The error appears even if this script is alone in the workflow. Does anybody know what it means?

    That error means that the script wasn't able to communicate with the targeted application properly, which can happen if the application crashes while the script is running. If that error doesn't cause any problems, it's appearance can be suppressed:
    try
    (your code)
    on error number -609
    end try
    This construct will not execute any code on or after the line which produces the error.
    (32099)

  • I want to write a script or Automator workflow/app that emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have experience?

    I want to write a script or Automator workflow/app that automatically emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have similar experience and know that this would work?

    I have had a first stab at the script, below.  It uses a file to store the shortcuts and command [descriptions].  You should be able to see from the script annotations how to add a new one.  (I populated 1-4 with real data, but got lazy after that, so you have a few placeholders to work with first.
    As I have noted, once you are happy that you have all the data in the file, you can comment out part of the script for ongoing use.  (BTW, my reluctance to use Excel is that I don't currently have it installed and I don't want to offer wrong advice.  If you have Numbers, I do have that and could probably modify to work with a spreadsheet from there.  This might be especially useful if you have the data already sitting in Excel.)
    A few things came-up whilist I was writing the script:
    1.     Currently, all recipients will not only get the same tip at the same time, but they will see the names and email addresses of the others who receive them.  It is possible to modify this.
    2.     I have added a property gRandomCheck which keeps track of which shortcut has already been used (since the last time the script was compiled.  This will prevent the same tip being sent more than once.    When all tips have been sent once, the script will alert you and not send anything until reset.  It does not check on a per-addressee basis (which would be a refinement).  (If you add a new addressee at this stage, the whole process will start again, and you may not really want this to be the behaviour.)
    3.     The way that I have built the list, commandList, is deliberately cumbersome - it's for the sake of clarity.  If you prefer, you can construct the whole list as {{shortcut:"X", command:"X"}, {shortcut:"Y", command:"Y"}}
    Have a look - I am sure you will have questions!
    SCRIPT STARTS HERE  Paste the following lines (thru the end) into a new AppleScript Editor document and press RUN
    --The property gRandomCheck persists between runs and is used to stop sending the same hint twice.
    property gRandomCheck : {}
    --I am defining a file on the desktop.  It doesn't have to be in this location
    set theFolder to path to desktop
    set commandFile to (theFolder as text) & "CommandFile.csv"
    --(* Unless you need to change the file contents you do not need to write to it each time.  Remove the "--" on this line and before the asterisk about 18 lines below
    --Follow this format and enter as many records as you like on a new line - each with a unique name
    set record1 to {shortcut:"Z", command:"Undo"}
    set record2 to {shortcut:"R", command:"Record"}
    set record3 to {shortcut:"⇧R", command:"Record Toggle"}
    set record4 to {shortcut:"⌘.", command:"Discard Recording & Return to Last Play Position"}
    set record5 to {shortcut:"X", command:"x"}
    set record6 to {shortcut:"X", command:"x"}
    set record7 to {shortcut:"X", command:"x"}
    set record8 to {shortcut:"X", command:"x"}
    set record9 to {shortcut:"X", command:"x"}
    set record10 to {shortcut:"X", command:"x"}
    set record11 to {shortcut:"X", command:"x"}
    set record12 to {shortcut:"X", command:"x"}
    set record13 to {shortcut:"X", command:"x"}
    --Make sure you add the record name before randomCheck:
    set commandList to {record1, record2, record3, record4, record5, record6, record7, record8, record9, record10, record11, record12, record13}
    --This part writes the above records to the file each time.
    set fileRef to open for access commandFile with write permission
    set eof of fileRef to 0
    write commandList to fileRef starting at eof as list
    close access fileRef
    --remove "--" here to stop writing (see above)*)
    --This reads from the file
    set fileRef to open for access commandFile with write permission
    set commandList to read fileRef as list
    close access fileRef
    --Here's where the random record is chosen
    set selected to 0
    if (count of gRandomCheck) is not (count of commandList) then
              repeat
                        set selected to (random number from 1 to (count of commandList))
                        if selected is not in gRandomCheck then
                                  set gRandomCheck to gRandomCheck & selected
                                  exit repeat
                        end if
              end repeat
    else
              display dialog "You have sent all shortcuts to all recipients once.  Recompile to reset"
              return
    end if
    --This is setting-up the format of the mail contents
    set messageText to ("Shortcut: " & shortcut of record selected of commandList & return & "Command: " & command of record selected of commandList)
    tell application "Mail"
      --When you're ready to use, you probably will not want Mail popping to the front, so add "--" before activate
      activate
      --You can change the subject of the message here.  You can also set visible:true to visible:false when you are happy all is working OK
              set theMessage to (make new outgoing message with properties {visible:true, subject:"Today's Logic Pro Shortcut", content:messageText})
              tell theMessage
      --You can add new recipients here.  Just add a new line.  Modify the names and addresses here to real ones
                        make new to recipient with properties {name:"Fred Smith", address:"[email protected]"}
                        make new to recipient with properties {name:"John Smith", address:"[email protected]"}
      --When you are ready to start sending, remove the dashes before "send" below
      --send
              end tell
    end tell

  • Applescript .app stopping Automator workflow

    Hi. I'm still a novice at Applescript, but getting better with Automator, and trying to combine the two to get the result I need, and I'm almost there except this one little glitch:
    I've got an Automator workflow that involves an Applescript application (.app) which for some unknown reason halts the rest of the workflow despite it seemingly working right. The Applescript does little more than quit a specific application, which it does. But when I run the workflow from Automator I get the error: "Connection is Invalid"
    Any help here would be greatly appreciated - is there something I should do differently with the script? Or should I handle this differently in Automator?
    Thanks!
    Below is the text of the script:
    tell application "OmniOutliner"
    tell every document
    try
    save
    on error errormessage number errornumber
    display dialog errormessage buttons {"OK"} default button 1
    end try
    end tell
    end tell
    quit application "OmniOutliner"

    First,
    '... is there something I should do differently with the script? ...' - Based only on the material provided - the AppleScript code (the 'save' line) assumes no 'Untitled' 'OmniOutliner' windows, otherwise the drop down 'Save' sheet will result with a 'Script Editor' error message of -> 'AppleScript Error. OmniOutliner Professional got an error: AppleEvent timed out.'. This error, or something similar, may be what is generating the 'Automator' 'Connection is Invalid' error message.
    Try the code below, in place of your AppleScript source code - with any needed modifications (such as 'OmniOutliner' in place of 'OmniOutliner Professional').
    -- Code starts here --
    tell application "OmniOutliner Professional"
    close (every document whose (name begins with "Untitled" and canUndo is false)) saving no -- Close any newly created documents, which have not been modified.
    set {tDocuments, dNames} to {documents, name of documents} -- Create lists of opened documents and the documents titles (names).
    repeat with i from 1 to (count tDocuments) -- Cycle through the tDocuments list.
    if ((item i of dNames) contains "Untitled") then -- If a newly created document, and recently modified - then, save it with a date stamped name, to the 'Desktop'..
    save (item i of tDocuments) in ((((path to desktop folder from user domain) as string) & (do shell script "date +%Y%m%d%H%M%SOmniOutliner.oo3")))
    else if ((canUndo of (item i of tDocuments)) is true) then
    save (item i of tDocuments) -- If a previously created document, and recently modified.
    end if
    end repeat
    end tell
    quit application "OmniOutliner Professional" -- Any opened but not modified documents, or any recently saved documents - will be closed here.
    -- Code ends here --
    Note: No detailed checking is provided, above, for files that contained 'Untitled' within the filenames, and were then opened in 'OmniOutliner Professional'; as opposed to, any newly created document - which will contain 'Untitled' as its name or the beginning of its name. Such is left as an exercise for the student.
    Second,
    '... should I handle this differently in Automator?' - Please provide the 'Automator' workflow Actions.

  • AppleScript to skip Automator workflow step - when no files are provided

    My current Automator workflow:
    Get Specified Finder Items (path to folder auto-populating with images from a camera)
    Get Folder Contents
    Sort Finder Items - by Creation Date in descending order (gets oldest item first)
    Limit Number of Items - Limit to First 1 items
    Move Finder Items (If no items are passed to this step skip it)
    Loop - Automatically; Stop after 20 minutes; Use the original input
    What I am trying to accomplish:
    I'm trying to write an AppleScript to skip the "Move Finder Items action" when it is not supplied with any files (from the previous workflow step), moving on to the next step which is a loop to begin my workflow again.
    Big picture:
    I have a workflow, where I am moving files from one folder to another folder (one at a time). When the input folder is empty, Automator comes back with "No item references were passed to the Move Finder Items action (-50)"; which it should - because it is not passed any files. I would like to ignore this error (or skip this step) and continue with the workflow if no files are provided to the "Move Finder Items action". I currently have an AppleScript (see below) that stops the workflow when this error occurs, but I would like to have this flow continue, not stop.
    AppleScript:
    on run {input, parameters}
              if input is {} then error number -128 -- 'user cancelled'
              return input
    end run
    Please help me create a script to skip this step, or to restart the Automator workflow when no files are passed to  the "Move Finder Items action".

    I'm not aware of a way to do this with a workflow saved as an application, but Automator is scriptable, so you can manipulate a workflow document.  For an example, build the follwing workflow:
    Ask for Text (just to get some input)
    Run AppleScript:
    on run {input, parameters}
      set currentAction to index of current action of front workflow -- the most recent completed action
      if input is {} then -- if no input then disable the following action
        tell Automator action index (currentAction + 2) of front workflow to set enabled to false
      else -- enable it
        tell Automator action index (currentAction + 2) of front workflow to set enabled to true
      end if
      return input
    end run
    Ask for Confirmation (just to show a dialog when enabled - this action will be enabled/disabled based on the text input)
    Loop
    You can also use action names, but I think it is less confusing to use indexes, since names can be edited and an action can be used more than once.

  • Create Automator workflow/AppleScript to automatically move files within NAS

    Running iMac / Macbook Air (OS 10.9.5), having the Macs connected wireless to the same network as a Seagate Central (NAS). On the Seagate Central and the iMac I have specified a couple of folders which are bidirectional synced via "Sync folders pro", e.g. pictures/movies folders. As a family, we have several iPhones (4S and 5S) with dedicated folders on the Seagate Central / iMac. Having the Seagate Media app on the iPhones, we are able to upload (and thereby free iPhone memory) pictures/movies directly onto the Seagate Central (pictures/movies which then are synced back onto the iMac). However, when uploading pictures/movies from the iPhone to the Seagate central (via Seagate Media app), it is not possible to define a target directory, and the pictures are therefore uploaded to a dedicated directory. I therefore search for some workflow/script to automatically (when new pictures/movies are uploaded, or at a daily basis);
    - Search for pictures/movies within a specific NAS folder
    - Move the pictures/movies to another specific NAS folder
    - Delete all other files/folders within the NAS folder being searched
    New to Automator / scripting, so I hope you bear with me even if the questions are dumb.
    Is it possible to make the NAS recognize a workflow/script without starting the iMac and/or MBA?

    Ok, so I made it a bit further, now having the following Automator Workflow (iCal)
    1. Get requested clients (check for ignore input from this action)
    - afp://192.168.1.86/Public
    2. Connect to client
    - I end up with a mounted disc (Public folder). Note that I end up at the same folder even if using afp://192.168.1.86/Public/iPhone/Photos in step 1.
    3. Get specified Finder items (check for ignore input from this action - to avoid having the Public folder itself following the workflow)
    - Choose the subfolder Public/iPhone/Photos
    4. Get folder content
    5. Filter Finder items
    - Did not get any results by using arguments as "kind is picture" and/or "kind is movie"
    - Ended up using arguments as "name contains jpg", "name contains mov" etc
    6. Move Finder items
    - Destination folder: Public/Pictures/iPhone
    - I now successfully managed to transfer the pictures and movies from one NAS folder to another
    *** I now want to continue the workflow to delete all other Folders/Files on Public/iPhone/Photos ***
    7. Get specified Finder items (check for ignore input from this action - to have no existing input for the remaining workflow)
    - Choose the subfolder Public/iPhone/Photos
    8. Get folder content
    - Results no showing a folder and a file
    9. Move Finder items to trash
    However, I´m encountering a couple of problems with this workflow;
    Note1: If there are no pictures/movies to move (no output from #5 going into #6), the workflow will stop. Any suggestions on how to skip step #6 and go to #7 if there are no pictures/movies to move? Applescript within Automator? Setting up the workflow as iCal (regular basis), so would be nice if the workflow just completes without errors (i.e. still goes on with deleting other files on the folder, even if there are no pictures/movies to move).
    Note2: Step #9 result in a error "Finder could not move the specified items to trash". Has this something to do with a folder and some other file being attempted deleted from a NAS folder? Any suggestions for how to cope with this problem?

  • Every time I sign into my Macbook, I get an error message from Automator; "The data couldn't be read because it has been corrupted.". I have never created an Automator workflow. How do I find out what Automator is trying to run and stop it?

    Every time I sign into my Macbook, I get an error message from Automator; "The data couldn't be read because it has been corrupted.". I have never created an Automator workflow. How do I find out what Automator is trying to run and stop it?

    Maybe it's set as a login item:
    - System Preferences: Users and Groups:
    - Highlight your user account in the left pane/list
    - Click "Login" tab at the top.
    See if you have an Automater action on the list
    - Note, you can select it, then right-click, and can then select "Reveal in Finder". That way you might have an idea what installed it.

  • Set Mail Signature with Run AppleScript Action inside an Automator workflow

    Hello,
    Not sure if I am posting this at the right spot, but I would need some assistance. I am trying to write an Automator Workflow application. The purpose for this application is to:
    1. Drag one or more attachments on the application/droplet icon
    2. Automator workflow creates a new mail message in Mail with the attached items already addressed and ready to go to
    I setup the following Workflow inside Automator:
    1. New Mail Message
    2. Add Attachments to Front Message
    So this is all working just fine. Now I would like to add a step in between of type "Run AppleScript". In this "Run AppleScript" action I have the following code:
    on run {input, parameters}
    tell application "Mail"
    set the message signature of input to signature "My Signature Name"
    end tell
    return input
    end run
    So my workflow looks now like this:
    1. New Mail Message
    2. Run AppleScript
    3. Add Attachments to Front Message
    I am getting the following error:
    Can’t make «class situ» "My Signature Name" of application "Mail" into the expected type.
    So, in essence I am trying to select a signature for that particular new mail message in this workflow. And that does not work. Any help would be appreciated.
    Martin

    first, you don't need the extra action to add attachments. if you drop some items on the saved application they will be passed to the "new Mail message" action as input and will be added as attachments. also, in my testing it seems that the processes of attaching the attachments seem to bump against the process of adding the signature. it get the same result as you originally but if I add a delay to the run applescript action then it works as it should so try
    1. new mail message.
    2. run applescript
    on run {input, parameters}
    delay 1
    tell application "Mail"
    set the message signature of (item 1 of input) to signature "My Signature Name"
    end tell
    return input
    end run

  • Automating installations -- changing network settings from AppleScript

    How can I change a computer's DHCP client ID's and name from AppleScript (or a shell script)? This is to automate Mac OS X deployments.

    This has been successfully resolved by electing to 'forget' both devices (the new AirPort Express unit and existing Time Capsule), doing a factory reset of both, and then re-scanning to add devices through AirPort Utility.

  • Convert Automator Flow to AppleScript??

    Hello AppleScript/Automator Gurus
    Firstly, I just started Automation this week with Automator but I've ran into a wall.. x.x   I'm hoping I can resolve this by means of AppleScripting.
    Below is an image of what I'm trying to do. It works great, unless there's no files matching. At this point, it denies going any further because theres nothing to 'Move'.
    What I actually want to do is (in steps):
    1. Get specified finder items >
    2. Get folder contents >
    3. Filter Finder Items by extension w/no folders selected >
    4. Move Finder Items to specified folder >
    5. If there is no Finder Items found to move skip >
    6. Repeat from step 1 to filter other extensions into appropriate folders unless there are no more steps or files then stop.
    Now I'm thinking if I could replace Step 4 (Move Finder Items) with an Applescript that would do this. Then insert Step 5. Eliminating the break in chain, so it can continue on to the next extension and do the same Steps 1-5.
    Then for the last move of the last group, an end if there are no files to move and no next step.
    If this has to be done all in Applescript from Step 1-6 I'm SOL (hoping not since I'm posting here).
    Thank you all very much for your attention and help. I apologize if this has been discussed before but I've been researching for a couple of days now and born unto Applescript as of yesterday I see it as a logical process but I have no idea where to begin or how to write Applescript. I'm a new Mac user since Feb, Automator since about 3 days ago and complete noob to Applescript. Any help is appreciated.

    Reviewing what you mentioned, seems extremely simple. Even moreso than Automator in a way
    In my opinion, AppleScript is easier - it's certainly easier to string together multiple discrete tasks, plus it's easier to read that one line and understand it's purpose than it is reading each step in an Automator workflow and knowing what it's trying to do.
    what if there are no files of that filetype left in the folder and there are only
    That's a fair question, right now, as it stands, it would throw an error ("can't get every file of folder.."). There are multiple ways of dealing with that. One is to add a specific test to check that files exist, another is to assume the best and just catch errors.
    To specifically check that some files were found the script needs to be expanded some:
    tell application "Finder"
              set files2Move to (every file of folder "Split Filetypes" of desktop whose name extension is "wav")
              if count files2Move > 0 then
                        move files2Move to folder "Path:to:your:WAVs"
              end if
    end tell
    Here the first statement gets a list of matching files and puts them in a variable I've called files2Move.
    I then check to make sure that files2Move actually contains some data (i.e. there aren't 0 files). If there are any files, I move them. If there are no files the move statement never executes.
    The alternative approach is to use a 'try' statement. This tells AppleScript to fail gracefully, rather than reporting an error, so in this case I can just try to move the files and ignore any failures:
    tell application "Finder"
              try
                        move (every file of folder "Split Filetypes" of desktop whose name extension is "wav") to folder "Path:to:your:WAVs"
              end try
    end tell
    Here I've wrapped the move command in a try/end try block. If an error occurs the script moves silently to the 'end try' statement without reporting an error to the user. Note that there are multiple things that cold constitute an error - the source or destination directories might be invalid or missing, there might be zero files that match the criteria, the destination directory might be read-only, etc. This script doesn't differentiate between any of those cases, it'll just try its best and move on.
    Can I just put in a move function to move those filetypes, written in applescript, that goes on to the next step in automator if no files are found?
    You can do that - Automator is built on top of the same underlying engine as AppleScript is. Indeed, there is a Run AppleScript action in Automator, so anything you can do in AppleScript you can add as a step in Automator. My problem with this though, is in passing data between the workflow and the AppleScript action. For me, I find it easier to write in AppleScript, so as soon as I find myself thinking in AppleScript I move the whole project there since integration is just so much easier.
    Applicatons and Folder Actions are not Automator-exclusives. Indeed, the original Folder Actions spec was AppleScript entirely - Automator put a slightly prettier front-end on it, but it was originally all AppleScript.
    Granted, building a Folder Action in Automator is easier since it takes care of saving the script in the right place and attaching it to the folder in question, but it's not hard to do in 'pure' AppleScript - you just need to add an appropriate handler so that the OS knows what to do when the folder is triggered.
    Of course, as a folder action you're no longer concerned with checking a specific directory. Since the folder action is attached to a folder (or, really, any folder) you should check the data that's passed in rather than rely on a hard-coded path.
    For example, to turn my script into a Folder Action that triggers on newly-added files, you wrap it like;
    on adding folder items to theFolder after receiving theNewItems
              repeat with each_file in theNewItems
                        tell application "System Events"
                                  if name extension of each_file is "wav" then
                                            move each_file to folder "Path:to:your:WAVs"
                                  end if
                        end tell
              end repeat
    end adding folder items to
    Now, this is a little different. Since it's a Folder Action it inherently knows the files that have just been added, so there's no need to query the Finder to find the WAV files - you can just look at the list of files that were passed in. You can just duplicate the 'if name extension... end if' statements for each of your file types, and you don't need to worry about there being zero files to move since the 'if' statements will identify the file types.

Maybe you are looking for

  • "Failed to talk to init daemon" after waking from suspend

    I got this shitty poulsbo driver and I've been having this issue for some time now. When I close the laptop lid and complete the suspend/wake-up process more than once, it no longer suspends and cannot poweroff/reboot the machine at all. When I try t

  • I have problem with Adobe Photoshop 7.

    I am attempting to open a file I have been working on for a week but it will not open the file and instead gives me a error message, "could not open file because an unexpected end of file was encountered".   I need to access this file as I am unable

  • System error in program CL_RSR_WWW_PAGE

    Hi BW gurus! when i try to export to excel from my report "Logistic dahsboard ", i have this error message : "System error in program CL_RSR_WWW_PAGE and form 01EXPORT_DATA:01      " SAP doesn't give any notes. Can anyone help me? Dev

  • Creating URL

    Hi! I had to put an URL to an object (a PM equipment). It has to be put with the "Services for object" button (located in the left of the dynpro title). I have to make it like this: Services for object button - Create - Create external document (URL)

  • Why does my MBP slow down throughout the day?

    If I reboot my MBP it will run very fast, nice and zippy.  But as the hours go on it seems to slow down to a crawl.  I am noticing this in particualr in PS where I can run a program called Portraiture (for example) that will run almost instantly afte