Breaking into Automator/Apple script

Hi,
I am needing to make some automator scripts with QuickTime in mind. Is there a source of tutorials or books? Or is it just easier to find a "Automator Scripter?"
Automator sounds just amazing, but where on earth do I start?
thanks,

The product page for Automator is a pretty good place to start. See the links on the side column under "Explore Automator" for some how-to's, website, and book recommendations.
If you have specific questions you can post them here on the board. If time is a factor you can hire assistance for very little money. I'm on iChat at [email protected] which is also my email address if you'd like to talk more about that.

Similar Messages

  • This one into a apple script

    How can I put this into an apple script
    sudo ditto -rsrc \
    /System/Library/User\ Template/English.lproj \
    /Users/admin

    Its been a long whiIe since I used applescript but, I believe you use the command:
    do shell script
    and then your script underneath.
    "sudo ditto -rsrc \"
    "/System/Library/User\ Template/English.lproj \"
    "/Users/admin"
    you may have to add something like this into it.
    user name "AdminUsername" password "AdminPassword" with administrator privileges
    Again its been a while but its a start

  • Please help!! Using Apple Script in Automator for Quicktime

    I would like to add some metadata to a batch of quicktime movies and then make the files unable to be altered and re-saved so that I can post them on the web. If I open a movie in quicktime and run the following apple script I can then perform save as of movie A into movie B and movie B cannot be altered.
    tell application "QuickTime Player"
    set saveable of movie 1 to false
    -- save self contained
    end tell
    I would love to be able to do this on a batch level in automator however I cannot figure out how to pass automator items to the apple script so that their saveable can be set to false, and after this I cannot figure out how to have to movies re-saved so the changes will take effect.
    Any help at all would be greatly appreciated.

    how are you passing files to apple script? as finder items?
    the following should work then
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on run {input, parameters}
    tell application "Finder"
    repeat with cur_file in input
    set fname to (name of (get info for cur_file) as text)
    tell application "QuickTime Player"
    open file (cur_file as text)
    set saveable of document 1 to false
    tell application "Finder" to set new_item to (path to desktop as string) & fname
    save self contained document 1 in new_item
    delay 1
    close document 1
    end tell
    end repeat
    end tell
    end run
    </pre>
    the above will dump the modified files onto your desktop and give them the same names they had before. You can adjust that as you like of course.

  • Automator or Apple Script To Move Multiple Files to Multiple Folders

    I was just wondering, is there any sort of automator workflow or maybe apple script that will allow me to automate the following:
    I have a folder named SCANS containing multiple different files that need to go to multiple different folders.
    So Say I have:
    SCANS
    and in this folder I have ten files named A,B,C,D,E,F,G,H,I,J and I want each of these files to be moved to different folders eg.
    A I want to go to folder 1
    B I want to go to folder 2
    C I want to go to folder 3 etc etc.
    Anyone know if there is a way of doing this please?
    I have tried a workflow where I find finder items in the Scans folder and move to another but that only seems to work for one file.  When I add more it does not seem to work.
    Any help/guidance would be appreciated.
    Thank you!

    Hi Niel,
    Not quite what I wanted because I missed some information from my question....
    What I actually want is to search for files containing certain text in the name and if positive to then move that file to the specified folders.
    Cheers.

  • Can Apple Script or Automator handle large client email tasks?

    Hi,
    I am a relatively new Mac user but currently work on a MacBook and Imac G5 with 10.4.9. I have a client list of approxamitely 900 people and I want to send an email to all 900 announcing a change in product services. Is there an Apple Script or automator script (or somewhere I could go to purchase one) that will allow me to import my name and email list in .csv or excel format and then send a slightly customized email to all. I just want the subject line and greeting to the email to include their first name so it looks as if I have taken the time to send them a personal email.
    Can anyone steer me in the right direction. Thanks in advance!

    Hi,
    Here's a script to disable a rule" --> tell application "Mail" to set enabled of rule "weekend message" to false
    Change "weekend message" by the exact name of your rule.
    Make an (iCal Events or Launch agent PLIST or cron) to run the script on Monday at a specific time.

  • Apple Script to automatically apply automator folder action workflows

    Hello
         I'm trying to get an applescript to automatically apply an automator folder action workflow to a folder..
         Getting applescript to apply a scpt file to a folder as a folder action is straight forward. However, it seems that scpt files are different than automator folder action workflows..
         Normally I would just script the folder action in apple script, but this is for someone that can handle automator, but not apple script coding. This whole scripting is to solve the issue of subdirectories being creating and then files or subfolders being created there after. So we need to try to get automator folder actions to propagate though..  easy enough with applescript..
    Any help would be appreciated...

    Here is the code that I needed to happen...  Maybe I just missed something in automator... but this applescript properly applies itself to subfolders, which then allows me to apply specific scripts based on folder names and locations. Also if the subfolders already exist.. the scirpt also is applied to those.
    on adding folder items to this_folder
      createlist(this_folder)
    end adding folder items to
    on createlist(item_list)
              set ActionScript to " REMOVED FOR PUBLIC DISPLAY:ApplyScriptSubfolders.scpt"
              set the the_items to list folder item_list without invisibles
              set item_list to item_list as string
                   repeat with i from 1 to number of items in the the_items
                     set the_item to item i of the the_items
                                       set the_item to (item_list & the_item) as alias
                                       set this_info to info for the_item
                                       if folder of this_info is true then
                              tell application "System Events"
                                                                          display dialog "Attching script to " & the_item as text  --
                                     attach action to folder (the_item as text) using ActionScript
                                                           end tell
                                my createlist(the_item)
                                       end if
                   end repeat
    end createlist
    I appreciate your help.. if you now know what has to happen and have a shorter way of doing so, please do so..
    Thank you again,

  • Apple script to find all image files on computer and put them into 1 folder

    Is there any way to do this with apple script? Thanks

    Hi glaurung,
    Doing this with vanilla AppleScript and the Finder would take too long. There might be a way to do this with unix commands, but probably the best way to this would be to use the built in find for your system. I wouldn't search the whole computer. Maybe just search somewhere in your Home folder. Use a criteria like all files with extension jpg, tiff, tif, etc.. Then you can just drag the found files into whatever folder you want. You need to be cautious because you wouldn't want to move all files. For instance, you wouldn't want to move all pictures in your iPhoto library, other apps, or the System.
    gl,

  • Automator workflow to an apple script

    Hello,
    i have a few problems with the automator utility:
    1. my automator work flow is to open an application and type a password.
    the problem is when i recored and i'm typing the password, after i'm running the workflow seems that its not possible to type password, is there a way to type password while recording?
    2. i have an automator workflow and i wish to convert it to an apple script.
    after i've copy paste it to the apple script editor it seems to be the workflow but when i running the
    script it not running.
    please help...
    Rafi.

    Since you're using Mail, you might be able to have Mail do it.
    You can set up a rule in Mail in its preferences to match an email with unique characteristics, such as certain content or a certain subject exactly. You might want to add a few conditions and "match all" to make sure you don't accidentally match something else.
    Anyways, you choose to have the rule run an AppleScript. I haven't tested it by referencing an Automator workflow, but it might work. You might try a quick test first with a simple workflow.
    You'd have to be logged in and have Mail automatically check for email, perhaps every minute or every five minutes. If you don't want to be logged in, likely you'll need to use a web page, like you suggested. I'm not sure what you need to do for that to work.

  • Renaming files with Automator & Apple Spript

    Hi there!
    I need the help of an expert in Automator & Apple Spript....
    I've got to rename 500 files with the following names:
    001-001 firstfilename.jpg
    104-095a otherfilename.jpg
    Any idea on how to get rid of the second number (that is 3 or 4 characters long, but always followed by a space) so to have something like:
    001 firstfilename.jpg
    104 otherfilename.jpg
    Thanks in advance & Ciao!
    Sergio
    Black MacBook   Mac OS X (10.4.7)  

    The following script should work.
    IMPORTANT:
    1) The files whose names you want to change must all be in the same folder. That folder must be open, and it must be the front finder window.
    (Also, no other files should be in that folder)
    2) Make a back-up of the files before you do this (just in case there is a problem. I hope the files are not too large)
    3) This should work if the file names are consistent. I have presumed that there is always a hyphen and a space ( ) and that you wish to keep the characters before the hyphen and after the space.
    4) Copy the script below into the script editor. When you have prepared 1 & 2 above then run the script. Good luck
    --Start of Script
    tell application "Finder"
    set myFiles to every file of the front window
    repeat with Cfile in myFiles
    set WholeName to the name of Cfile
    set AppleScript's text item delimiters to "-"
    set WNlist to every text item of WholeName
    set WNpart1 to first item of WNlist
    set AppleScript's text item delimiters to " "
    set WNlist2 to every text item of WholeName
    set WNpart2 to last item of WNlist2
    set NewName to WNpart1 & " " & WNpart2
    set name of Cfile to NewName
    end repeat
    end tell
    set AppleScript's text item delimiters to ""
    --End of Script
    MacBook   Mac OS X (10.4.7)   iMac G4 (10.3.9)

  • Apple script to java script...

    Hi everyone,
    As i want to change below apple script code to java script. I have tried upto duplicating the frames with java script and its working fine. But i don't know how to use whose condition in javascript. If it is possible to do whose condition  in java script then i don't want to go for loop. Can anyone look into this and help me out.
    -----Apple script-----
    set xx to {}
    tell application "Adobe InDesign CS3"
        tell document 1
            repeat with i from 1 to (count of text frame)
                if class of parent of parent of text frame i is not in master spread then
                    set end of xx to id of text frame i
                end if
            end repeat
            duplicate (every text frame whose id is in xx)
            delete (every text frame whose id is in xx)
        end tell
    end tell
    //---Java script---
    var doc=app.activeDocument;
    var myFrames=doc.textFrames.everyItem();
    myFrames.duplicate();
    Thanks in advance
    Thiyagu

    Hi Kasyan,
    I have checked with your code its working fine. Thanks for your valuable & great support. I was out of station for past one week. Thats the reason for no reply.
    After posted my query in to forums, in the mean time i developed the script. In this script i supposed to use the same approach to unlink frames, by getting frame IDs of the text frames. For time consuming only i expected the equivalent code of JS. For your reference i have posted my script below.
    var doc=app.activeDocument;
    var myArray=new Array();
    var myFrames=doc.textFrames.everyItem().id;
    for(j=0; j<myFrames.length; j++)
            myArray.push(myFrames[j]);
    doc.textFrames.everyItem().duplicate();
    var myDupFrames=doc.textFrames;
    for (k=0; k<myDupFrames.length; k++)
        for(s=0; s<myArray.length; s++)
            if (myDupFrames[k].id==myArray[s])
              myDupFrames[k].remove();
              break;
    Also i have modified my script  after seen your post. And it is working greatly. Once again i am thanking you.
    Regards
    Thiyagu

  • Apple Script to close down all volumes on TrueCrypt.

    I like to create script that will close down all mounted volumes in TC.
    Does anybody know how to script the programme (preferably in Apple Script, but Automator would be OK to) in such a way as to be able to have the script do a ‘Dismount All’?
    I would than link this to the ttys file as a LogoutHook, thus making sure all mounted volumes are dismounted before a shut down happens, this to prevent damaging open files on a volume as this could happen if shut down is forced.
    Any suggestions appreciated.

    TrueCrypt probably doesn't know about disks/volumes, but the system does. Eject is a different command than unmount, so I am guessing that there is something else going on in there. The following script gets the local volumes and uses diskutil to unmount the specified volume(s):
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- unmount local disk volumes
    set Unmounted to "" -- this will be a text list of volumes successfully unmounted
    tell application "Finder" to set LocalNames to (name of disks whose local volume is true)
    set TheVolumes to (choose from list LocalNames with prompt "Choose volumes to unmount:" with multiple selections allowed)
    if result is not false then repeat with SomeName in TheVolumes
    -- get the disk identifier for the specified volume
    get paragraphs of (do shell script "diskutil list " & quoted form of ("/Volumes/" & SomeName))
    set TheDiskID to the last word of (Test for SomeName out of result)
    -- unmount (the disk ID is used in case there are multiple volumes on a disk)
    if TheDiskID is not "" then try
    do shell script "diskutil unmount " & TheDiskID
    set Unmounted to Unmounted & SomeName & return
    on error errmess
    log errmess
    end try
    end repeat
    if Unmounted is "" then set Unmounted to "none"
    display alert "Volumes unmounted:" message Unmounted
    to Test for SomeText out of SomeList
    tests if  SomeText is in an item of SomeList
    parameters - SomeText [text]: the text to test for
    SomeList [list]: a list of text items to test
    returns [text]: the first item of SomeList that contains SomeText, or "" if none
    set SomeText to SomeText as text
    repeat with AnItem in SomeList
    set AnItem to AnItem as text
    if SomeText is in AnItem then return AnItem
    end repeat
    return ""
    end Test
    </pre>

  • Apple script to copy folder contents

    I am looking for help to create an apple script, or automator task that will copy the contents of a specified folder and paste them into another specified folder. There will just be a couple of files within this folder, and each time it creates the duplicate I dont want it to erase pervious copies already created within the destination folder, so it will probably need to change the name of the file (....1, ...2, ....3, something like that).

    I tried setting up this automator app
    You have to drop folder A onto the app ignored for it to do it's thing. Dropping folder A
    on to it 3 times in a row gives this in folder B.
    You can experiment with the app to get what you want.  One should be able to create that script as a folder Action so that any file dropped into folder A will automatically get copied to folder B.  I was unable to get that to work.  Maybe someone with more experience with Automator can help in that area.

  • Applescript Input into Automator input...

    I have a nice little applescript (on run.. inputObects) that presents a list of actions to perform on the files dropped. One of these actions is a simple copy using cp in the shell. Everything works great, execept, I need a way to cancel the script. yes, I could do a file > Quit on the scrip App. But, for my users, that is not convenient. I like how automater puts a 'cog' in th menubar that you can 'cancel' a script with. However, my applescript is too complicated for automator as the main app because of resources and other things I am doing.
    I tried creating a 'dummy' automater script that delays indefinently but has an 'on quit' hander quitting the main applscript app. However, when choosing to 'cancel the workflow' from the cog, it does not run the worflows 'on quit' handler.. and thus does not solve my problem.
    That said, I desire to change to bavior for the applscript to open an automater app that does the actions instead of nesting them in my main script....Unless there is a better way to implement a "cancel" of Applscript while it is doing 'stuff'.
    So, does anyone know how to send the same input from the dropped-on file into the automator's inputs? and then get the return?
    here is a code scketch.. very simplified.
    mainApp.app (applescript read-only app):
    on open of inputObjects
              set workerPath to quoted form of POSIX path of (path to resource "Worker.app" in directory "Scripts")
      do shell script "open " & workerPath & inputObjects
      -- now, get the output form the automator script..
      display dialog allNames
    end open
    Automator, applescript (Worker.app):
    on open of inputObjects
              repeat with i in inputObjects
                        set fileCopies to fileCopies & inputObjects
                        set fposix to the quoted form of the POSIX path of i
                        do shell script "cp -f " & fposix & " ~/Desktop/"
      --- GET ALL THE FILENAME(S) of files dropped
                        set oD to AppleScript's text item delimiters
                        set AppleScript's text item delimiters to {"/"}
                        set fileName to (last text item of fposix)
                        set AppleScript's text item delimiters to oD
                        set AppleScript's text item delimiters to "."
                        if number of text items of fileName > 1 then
                                  set finalName to text items 1 thru -2 of fileName as text
                        end if
                        set allNames to allNames & "\n" & finalName
              end repeat
              return allNames
    end open

    I spent a good amount of time last night analyzing the code and trying to implement the applscript into it...
    simple processes I had setup work fine.. like what I tested. However, I have on batch re-namer that runs before any progress bar code or functions and it no longer likes how I am getting the file inputs.
    current code:
    else if selectedAction = "Batch Rename" then
                        set theName to the text returned of (display dialog "Enter Base File Name" default answer "")
                        set counter to "1"
                        set numberOfFiles to count of someItems
                        tell application "Finder"
                                  set digits to ((length of (numberOfFiles as text)) + 1)
                                  repeat with i in someItems
                                            set itemExtension to name extension of i
                                            if itemExtension is not "" then set itemExtension to "." & itemExtension
                                            set counter to text -digits thru -1 of ("00000000000000" & (counter))
                                            set the name of i to (theName & "_" & counter & itemExtension)
                                            set counter to text -digits thru -1 of ("00000000000000" & (counter + 1))
                                  end repeat
      display dialog "Rename Complete!" buttons {"OK"} default button 1 with icon path to resource "droplet.icns" in bundle (path to me)
                        end tell
              end if
    I placed all the progress bar functions into one big function  "progressBarApplication(someItems)" That I can then call when I need to only on certain opperations of the script.. but the renamer will not work even withouth this function. perhaps it is the way the cocoa script works vs a basic apple script?

  • New to apple script...

    Hi I am new to apple script; I was using Automator but it became too dumb to it's surroundings after a while. Can you please tell me why these don't do what I think they should; Safari has 2 windows open one with four tabs (window 1 as I have used exists to be sure of) and one with 9 (window 2).
    tell application "Safari"
    activate tab 6 of window 2
    end tell
    all it does is bring the frontmost safari window up
    Please help

    There are a couple of reasons behind this, mostly because you're using the wrong command.
    The main thing is that the 'activate' command is used to activate the application. Any other parameters (such as 'tab 6 of window 2') are discarded.
    Instead, the appropriate syntax is to set the current tab property of the window:
    tell application "Safari"
      set current tab of window 2 to (tab 6 of window 2)
    end tell
    It's a little verbose, but it works.
    If you also want to bring that window frontmost you need to change its index:
    tell application "Safari"
      tell window 2
        set current tab to (tab 6 of window 2)
        set index to 1
      end tell
    end tell
    Note though that changing the window index will now also change this window to 'window 1' instead of 'window 2'. Something to bear in mind if you're taking further actions.

  • How can I get the size of a file with apple script

    I try to get the size of a file within an apple script. But I did not find information how to do this.

    There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
    set myFile to selection as alias
    --this just gets a file for me to work with
    --coercing it into an alias is required for the other functions
    end tell
    tell application "System Events"
    get size of myFile
    end tell
    set myInfo to (info for myFile)
    get size of myInfo

Maybe you are looking for

  • White Screen of Death :(

    I am wondering if someone might help me. I have a late 2012 Mac Mini and when booting the Mac with just the mouse, keyboard, display and power all I get is the Mac chime and then a white screen. Nothing else on the screen and no matter what combinati

  • Acrobat Pro 11 - Output Preview not working

    This issue came up again on my Macpro. Although it's ok on my MBP. When try to analyze a PDF in "Output Preview" a few things aren't working for me. The "Total Area Coverage" warning will not display on screen. Also when I hover the cursur over the P

  • I have iphone 4s and i am not able to open it , i recieve a message that this iphone is linked to an apple id which i forgot

    i have iphone 4s and i am not able to open it , i recieve a message that this iphone is linked to an apple id which i forgot

  • Macbook Pro not turning on and having no responses

    Hi there. I recently bought a macbook pro, I had been having trouble with my internet connections then when I finally have it sorted out the computer just turned off out of the blue.   I've tried researching and using the troubleshooting methods i've

  • Campus Network Question

    In a Campus Network design where you have Core switch, Distribution switch and Access switch layers and SVI's acting as your gateways for different VLANs. Since it is advised that Core Switches should be the root bridges, does that mean that the Core