Re: What makes AppleScript difficult
Re: What makes AppleScript difficult
- Subject: Re: What makes AppleScript difficult
- From: Luther Fuller <email@hidden>
- Date: Mon, 10 Dec 2007 16:22:32 -0600
Just ran into a situation that reminded me of a complaint I made
years (decades ?) ago. A couple of weeks ago, I put together a
quickie script in an afternoon. Used Drag & Drop. At some point I
added a Select & Launch interface. Today I was getting all the
details working exactly and precisely right. Then I noticed that I
really didn't want to have alias files in the selection, because that
could lead to bizarre or even dangerous behavior.
So I modified the code to filter out alias files. Then ...
I remembered that the list passed to the 'open' handler is a list of
aliases in which alias files are always resolved. Bad news. So I
changed the 'open' handler to 'main'. No more Drag & Drop. THIS IS A
BUG. Alias files passed to an 'open' handler should never be
resolved. Sometimes I may filter out alias files, sometimes not and
sometimes they should be resolved. The choice should be mine. I would
have liked to include a Drag & Drop interface, but in this case, it
is just too dangerous.
I would like to see this fixed!
And I also noticed ...
The Finder's 'selection' is a list of file references;
and
The open handler's dropped items list is a list of aliases.
Both of these lists always end up in the same place, so I always have
to convert the 'selection' list to a list of aliases. Why the
difference?
It seems that an easy fix would be something like ...
tell application "Finder"
set x to selection as alias list
which I tried a few minutes ago. It doesn't work.
_______________________________________________
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