Re: Rename Droplet Works in OS 9 But Not X
Re: Rename Droplet Works in OS 9 But Not X
- Subject: Re: Rename Droplet Works in OS 9 But Not X
- From: John Delacour <email@hidden>
- Date: Thu, 3 Jul 2003 21:10:46 +0100
- Mac-eudora-version: 6.0a25
At 10:41 am -0700 3/7/03, Alatorre, Michael wrote:
Here is a simple rename droplet that works in OS 9:
on open theFile
tell application "Finder"
select theFile
set name of selection to "PEAC-SMG.xls"
end tell
end open
That's not the way to use the open handler, though it will work if you say
set name of (get item one of selection) to ....
When you drop items on a droplet you are handing the script a _list_
of aliases. The Finder's selection is a _list_ of 'document files'.
Do something like this:
on open _droppedItems -- (a list)
repeat with _item in _droppedItems -- each (alias in the list)
tell app "Finder" to get the _item's name
display dialog result
end
end
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.