Re: Move files to the right folder.
Re: Move files to the right folder.
- Subject: Re: Move files to the right folder.
- From: kai <email@hidden>
- Date: Wed, 18 Oct 2006 19:10:53 +0100
On 16 Oct 2006, at 15:14, Mark J. Reed wrote:
The most annoying part of doing that with AppleScript is getting the
leading 0s into the folder names. :)
In this situation, Mark, I suppose one might argue that any leading
zeros are already contained by the file names (assuming, of course,
that they're all accurate):
------------
set fileName to "BE_00097_M3200W"
set oldDelim to text item delimiters
set text item delimiters to "_"
tell text 1 thru 3 of fileName's text item 2 to ¬
set folderName to it & "00-" & it & "99_Vendor_Code"
set text item delimiters to oldDelim
folderName --> "00000-00099_Vendor_Code"
------------
If file names consistently start with 2 characters and "-", then the
folder name could be derived even more directly:
------------
set fileName to "BE_00158_M1370"
tell fileName's text 4 thru 6 to set folderName ¬
to it & "00-" & it & "99_Vendor_Code"
--> "00100-00199_Vendor_Code"
------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden