Beginner in Automator looking for help

Soldato
Joined
30 Dec 2004
Posts
2,869
Location
Stoke-on-Trent
I'm looking to use automator to move files to various according to their extension when I copy them into a folder and I was wondering if anyone could start me off on how to write it and answer a few questions.

Copy file with extn .pdf to folder 1
copy file with extn .jpg to folder 2 (which is actually an alias but I don;t think this matters? or does it?)
etc...

Do these scripts run automaticalyl or do you have to run them manually?

Sorry for noob q's but I'm just getting the hang of the Mac stuff.
 
Are you going to be writing this in Applescript? I'm not familiar with the actual syntax, but the pseudo code would presumably run along the lines of:

1) Run when a file is copied into the folder
2) Split name up by full stops
3) Take item after final full stop
4) Use a switch statement to determine what to do with a given file type
5) For each case, copy the file to the relevant place
6) If no match is found, leave it where it is

I see no reason that this can't be done in Applescript, assuming you can get it to run each time a file arrives in the folder and assuming Applescript supports switch statements, which it certainly should.

Also - it won't matter that the second folder in there is an alias. As far as you and the OS are concerned, the folder is actually there.
 
You don't actually need to mess around with writing Applescript yourself. Launch Automator and create a new workflow. It's all pretty intuitive in terms of dragging the actions from the left into the appropriate order on the right.

I'm not on my mac right now, but you'll need something like "Get Finder Items", and you can select the file type eg pictures, jpg, pdf whatever
"Move" and select the destination location

The workflow can then be saved as an application and run whenever you want it by launching it. Alternatively, you can assign it is a 'folder action', so that whenever the contents of the folder changes, the action is run and sorts the files

here's a tutorial. Let me know if you need any more help and I can assist when I get back home to my mac
http://appleswitcher.com/2006/03/14/automator-and-folder-actions-tutorial/
 
You don't actually need to mess around with writing Applescript yourself. Launch Automator and create a new workflow. It's all pretty intuitive in terms of dragging the actions from the left into the appropriate order on the right.

I'm not on my mac right now, but you'll need something like "Get Finder Items", and you can select the file type eg pictures, jpg, pdf whatever
"Move" and select the destination location

The workflow can then be saved as an application and run whenever you want it by launching it. Alternatively, you can assign it is a 'folder action', so that whenever the contents of the folder changes, the action is run and sorts the files

here's a tutorial. Let me know if you need any more help and I can assist when I get back home to my mac
http://appleswitcher.com/2006/03/14/automator-and-folder-actions-tutorial/

That's exactly what I was looking for - thanks. I'll give it a go when I get home and hopefully it'll work.
 
Back
Top Bottom