p01 Kansas City Southern
Skip to main content

Recent Topics

xx

xx

angry
Trouble with InD VDP
by delooch
May 21, 2018, 06:01:35 PM

xx
Adobe Creative Cloud Price Increases
by Joe
May 17, 2018, 05:48:25 PM

xx
PKG Installer Inspection
by Slappy
May 17, 2018, 01:36:00 PM

xx
Business Card order
by scottrsimons
May 16, 2018, 10:27:26 AM

xx
Ink saving,4d colour conversion
by danydany
May 16, 2018, 10:10:07 AM

xx

clip
java and 3D Export
by Joe
May 15, 2018, 08:42:11 PM

xx
Individual Page Proofs
by Slappy
May 14, 2018, 11:12:05 PM

xx
Prinergy 1st Refines Questions
by DPSprint
May 14, 2018, 10:48:01 PM

xx
Xeikon Indigo toner press Iso standards
by danydany
May 14, 2018, 10:21:55 AM

xx
Still alive!
by motormount
May 12, 2018, 12:49:13 PM

xx
VDP Brainfart
by Slappy
May 10, 2018, 10:37:27 PM

Topic: Re: AppleScript/Automator to create folder based on partial file name, move files (Read 675 times) previous topic - next topic - Topic derived from Re: AppleScript/Autom...

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #15
That sounds good, does this script need adjusting?
I see it says "your script goes here"
also I don't know how to save it as a Service with Automater
can you give me the steps on how to use this? very interesting.

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #16
Tracy, when creating a new Automator doc, you can select “Service” or another option.

Screenshot attached.

I’d advise you to Google up and search for Automator and or AppleScript sites, there are many websites out there with great info to get beginners past the initial hurdles of getting started.

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #17
Hey thanks Swampy!
That should help

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #18
Hey thanks Swampy!
That should help

After creating your new blank service in Automator, copy/paste in the code and hit the “compile” spanner icon as attached.

To run, contextual/control/right click on a file and select your service command.

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #19
That sounds good, does this script need adjusting?
I see it says "your script goes here"
also I don't know how to save it as a Service with Automater
can you give me the steps on how to use this? very interesting.

No adjustment required, the bit that is marked as:

(* Your script goes here *)

Is what is known as a “comment” which is ignored by the scripting engine and is used to document the script.

That line can be left, or removed.

In an earlier post I showed AppleScript code in two separate attachments, one “complex” and one “simplified”.

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #20
As previously mentioned, I personally find ExifTool a whole lot easier to use and it is easy enough to put it into an Automator service for easy right click access.

The AppleScript code posted by Fat Boy Tim used 43 lines of code and 1051 characters.

The equivalent ExifTool command only uses 1 line of code and 91 characters and is cross platorm (apart from the specific shell script bits that are Mac OS only).

Both methods process "instantly" and will create a new folder based on the filename of the selected file and move the file into the newly created folder. The ExifTool command has the advantage of working on multiple selected files. Of course, ExifTool can “only do so much" and it is not a scripting language, so it is a case of horses for courses.

Code: [Select]
/usr/local/bin/exiftool '-directory<${directory}/${filename;s/(^.+)(\.[^.]*$)/$1/}' -r "$@"

 

Re: AppleScript/Automator to create folder based on partial file name, move files

Reply #21
This is excellent stuff, I will practice it an read about it.
I hope I get it!
wish you guys were here  :laugh: