Re: Applescript Help...
Re: Applescript Help...
- Subject: Re: Applescript Help...
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 19 Jul 2007 14:54:23 -0400
Well, with one of the handy "rename" utilities that let you generate
the new filename via arbitrary regex-fu on the old one, this is a
shellscript one-liner, something like this:
do shell script "rename 's," + quoted form of posix path of
sourceFolder + "/([^/]*)/(.*)," + quoted form of posix path of
targetFolder + "/${1}_$2,' " + quoted form of posix path of
sourceFolder + "/*/*"
But since no such utility comes standard with OS X, a shellscript
solution would be longer, and so the best solution is probably to
stick with Finder scripting rather than the shell.
Unfortunately I can't even figure out how to get the Finder to give me
the contents of a folder, so I'll shut up and let someone else address
that part...
On 7/19/07, Don Wieland <email@hidden> wrote:
For example, let's say we have these files:
Source/0001/Image1.jpg
Source/0001/Image2.jpg
Source/0001/Image3.jpg
Source/0001/Image4.jpg
Source/0002/Image1.jpg
Source/0002/Image2.jpg
Source/0002/Image3.jpg
Source/0002/Image4.jpg
Source/0003/Image1.jpg
Source/0003/Image2.jpg
Source/0003/Image3.jpg
Source/0003/Image4.jpg
They we be renames and moved to a FOLDER called TARGET:
Target/0001_Image1.jpg
Target/0001_Image2.jpg
Target/0001_Image3.jpg
Target/0001_Image4.jpg
Target/0002_Image1.jpg
Target/0002_Image2.jpg
Target/0002_Image3.jpg
Target/0002_Image4.jpg
Target/0003_Image1.jpg
Target/0003_Image2.jpg
Target/0003_Image3.jpg
Target/0003_Image4.jpg
That's the result I need.
Any help would be appreciated ;-)
Don Wieland
DW DATA CONCEPTS
~~~~~~~~~~~~~~~~~~~~~~~~~
Direct Line - (714) 389-4026
Fax - (714) 389-4027
email@hidden
http://www.dwdataconcepts.com
Integrated data solutions to fit your business needs.
APPOINTMENT 1.0v7 - Add powerful scheduling to your database system.
http://www.appointment10.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden