Re: Folder name from alias
Re: Folder name from alias
- Subject: Re: Folder name from alias
- From: Michelle Steiner <email@hidden>
- Date: Thu, 7 Dec 2000 22:59:43 -0800
On 12/7/00 9:48 PM, Rick Plummer <email@hidden> wrote:
>
I need script that will extract the folder name of a folder
>
dropped on an applet (for use later inthe script).
>
>
e.g.:
>
on open x
>
tell application "Finder"
>
yada
>
yada
>
make new folder at (location) with properties
>
{name:<folder name from x>}
Some of this code is for illustration purposes only
on open {theitem}
(*
braces force only first item to be passed; this assumes that you will be
dropping only one item at a time on the droplet.
*)
if folder of (info for theitem) then
set {text item delimiters, OTID} to {":", text item delimiters}
set folderName to text item -2 of (theitem as text)
set text item delimiters to OTID
display dialog folderName --just to show that it works.
else
--handle files as you need
end if
end open
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------