• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Move files to the right folder.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Move files to the right folder. (From: Jan Bultereys <email@hidden>)
 >Re: Move files to the right folder. (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: App and droplet
  • Next by Date: Re: Move files to the right folder.
  • Previous by thread: Re: Move files to the right folder.
  • Next by thread: Re: Move files to the right folder.
  • Index(es):
    • Date
    • Thread