• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Alias Forms as Property (Was: Applescript-users Digest, Vol 1, Issue 177, Message 3)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Bridge anyone? [not off topic]
  • Next by Date: Fraction Maker Revisited Solved?
  • Previous by thread: [OT]Mystery message on Script Editor
  • Next by thread: Re: Alias Forms as Property
  • Index(es):
    • Date
    • Thread