• 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: Accessing raw alis data via AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing raw alis data via AppleScript


  • Subject: Re: Accessing raw alis data via AppleScript
  • From: Philip Aker <email@hidden>
  • Date: Sun, 15 Mar 2009 14:09:34 -0700

On 2009-03-15, at 11:55:56, Steven Audette wrote:

I would like to get/set the raw data of an Alias ('alis') in AppleScript.

For example, if you run:
set foo to path to current application

AEPrint (in Script Debugger) shows the type of foo to be:
'alis'($000000000180 ...... 012F00FFFF0000$)

I want to extract the value inside 'alis' into a variable.  Later, I want re-create this 'alis' with that data which can later be resolved and used within the AppleScript again as a regular Alias.

I have tried coercing the value into another type (string, text, data, etc), but it always results in an error.  Are their any tricks to accessing this raw data?

One possibility is to write them to a file on disk and read them again later. Here, only one alias being stored and retrieved but it should be possible to store lists of them in the same file.

set fpath to (path to desktop as text) & "alias.storage"
set p2a to path to current application
set res to missing value
try
set f to open for access fpath with write permission
write p2a to f
close access f
on error errs number errn
try
close access f
end try
return errs
end try
try
set f to open for access fpath
set res to (read f as alias)
close access f
on error errs number errn
try
close access f
end try
return errs
end try
res




Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

  • Follow-Ups:
    • Re: Accessing raw alis data via AppleScript
      • From: Steven Audette <email@hidden>
References: 
 >Accessing raw alis data via AppleScript (From: Steven Audette <email@hidden>)

  • Prev by Date: Accessing raw alis data via AppleScript
  • Next by Date: Re: Stock Quotes using AppleScript
  • Previous by thread: Accessing raw alis data via AppleScript
  • Next by thread: Re: Accessing raw alis data via AppleScript
  • Index(es):
    • Date
    • Thread