Re: Alias Forms as Property (Was: Applescript-users Digest, Vol 1, Issue 177, Message 3)
Re: Alias Forms as Property (Was: Applescript-users Digest, Vol 1, Issue 177, Message 3)
- Subject: Re: Alias Forms as Property (Was: Applescript-users Digest, Vol 1, Issue 177, Message 3)
- From: kai <email@hidden>
- Date: Sun, 7 Nov 2004 02:46:09 +0000
On Fri, 05 Nov 2004 21:55:05 -0800, Paul Berkowitz wrote:
It would be nice to be able to save the alias as a property in a way
that
could be trapped if the file has been deleted. But I don't know any
way.
With things as they stand, the only way that I can think of is to store
the property separately from the main script, using either load/store
script or read/write file. It's a somewhat cumbersome and inelegant
workaround at best - but in case anyone might find it useful, here's a
read/write example:
----------------
to getTgtFile() -- returns an alias
tell file ((path to preferences as Unicode text) & "aliasData") to try
(read it as alias) as Unicode text as alias
on error number -43 -- file not found
set f to choose file with prompt "Where is the target file?"
set o to open for access it with write permission
write f to o
close access o
f
end try
end getTgtFile
set tgtFile to getTgtFile()
-- do something with tgtFile
----------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden