Re: Addressing an item by the first six characters of it's name
Re: Addressing an item by the first six characters of it's name
- Subject: Re: Addressing an item by the first six characters of it's name
- From: John Delacour <email@hidden>
- Date: Fri, 6 Sep 2002 22:44:39 +0100
At 9:53 am -0400 6/9/02, Chad Chelius wrote:
I am writing a script that will create a list of folders within a folder and
I want the script to go through that list and based on the first six
characters of it's name, select items in another folder whose first six
characters match that of the item in the list. I am only in the beginning
phases of applescript and appreciate anybody's input. Thanks in advance.
This script is a bit circular and useless and could easily break but
it ought to give you some idea how to do what you want -- which
sounds a bit risky anyway.
set f to path to current user folder
set sixList to {}
tell app "Finder" to set nameList to the name of every folder in f
repeat with vName in nameList
if (count vName) is greater than 5 then
copy text 1 through 6 of vName to the end of the sixList
end if
end repeat
set vMatches to {}
repeat with s in sixList
tell app "Finder"
set end of vMatches to((folders in f whose name begins with s)as string)
end
end repeat
vMatches
JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.