Re: Get only the name of the file, instead of the whole path!
Re: Get only the name of the file, instead of the whole path!
- Subject: Re: Get only the name of the file, instead of the whole path!
- From: KOENIG Yvan <email@hidden>
- Date: Wed, 16 Jan 2008 22:22:30 +0100
Le 16 janv. 2008 à 20:59, Stockly, Ed a écrit :
Good afternoon all!
Good morning!
How can I get only the name of a file, instead of the whole path?
Here are my
tries!
on adding folder items to this_folder after receiving added_items
repeat with thiFile in addedItems
set AppleScript's text item delimiters to ":"
set fileName to the last text item of (thisFile as string)
end repeat
Etc....
Oops,
you forgot to reset the AppleScript's text item delimiters
to its original value, this may give very odd results ;-)
It seems that the goal is to get the name of the last item in the list
maybe
set lastItem to (last item of added_items) as text
set AppleScript's text item delimiters to ":"
set fileName to the last text item of lastItem
set AppleScript's text item delimiters to "" (*empty string is the
standard delimiter *)
would do the trick
Yvan KOENIG _______________________________________________
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