Droplet and Aliases...how?
Droplet and Aliases...how?
- Subject: Droplet and Aliases...how?
- From: Richard 23 <email@hidden>
- Date: Tue, 2 Jan 2001 17:11:10 -0800
>
Question to everyone: If an alias is dragged onto the droplet, the
>
alias's original will be locked; what changes are needed to lock the
>
alias file? I can't figure that out.
The Finder is very kind and resolves aliases for you. I discovered
this wasn't always so useful when writing my UpdateAlias script:
<
http://homepage.mac.com/richard23/applescript02.html#UpdateAlias>
which updates which presents a list of all files in the same directory
as the original where the root name matches, allowing you to choose
which file the alias points to.
This is useful if you append a version number to your script's filename
and store all versions of the same script in the same folder.
I do this and place an alias (without the version number) in my OSA Menu
script folder then use drag-and-drop to update aliases when I complete
a new version of a script. I have hundreds of scripts so versioning
is the only way I can keep track.
Finally an answer:
Get the Finder's selection, making sure to coerce to an alias list
if you're planning on using a standard open handler otherwise you
may be confused later.
Open gets aliases, while "selection of application 'Finder'" gets
Finder references. This handler works consistently for me:
--
---------------------------------------------------------------------------
--
-- simulates drag and drop while running in editor with alias list
workaround
--
---------------------------------------------------------------------------
--
on FinderSelection()
tell selection of application "Finder" to try
get it as alias list
on error
get it as alias as list
end try
end FinderSelection
If you want the definitive answer to deal with some well known alias list
deficiencies you should really check out my AliasList library file:
<
http://homepage.mac.com/richard23/applescript02.html#AliasList>
R23
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This has been a paid advertisement for R23's One Step Beyond website. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *