• 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 Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alias Files


  • Subject: Re: Alias Files
  • From: Philip Aker <email@hidden>
  • Date: Mon, 4 Aug 2008 07:09:04 -0700

On 2008-08-03, at 08:15:57 , Luther Fuller wrote:

I just tried GetAliasTarget with this script (compiled as an application bundle) and it works.

tell application "Finder"
set selfRef to (path to me)
set localRef to (container of selfRef)
try
set aliasRef to (some alias file of localRef)
on error errText number errNr
"Alias does not exist"
display dialog the result buttons {"Cancel"} default button 1
end try
--
try
original item of aliasRef
on error errText number errNr
((item "GetAliasTarget" of folder "Resources" of folder "Contents" of selfRef) as alias) as text
(quoted form of POSIX path of the result) & space & (quoted form of POSIX path of (aliasRef as text))
do shell script the result
"Missing original item ..." & return & the result
display dialog the result
return
end try
--
display dialog (the result as text) & return & "Exists!"
end tell


The Finder's errText for a missing original item is ...
	Finder got an error: Can’t get original item of alias
	file "TARGET_FOLDER" of folder "Alias_TESTS" of
	folder "Desktop" of folder "lutherfuller" of
	folder "Users" of startup disk.

It should say something like ...
Missing original item: "OS_X:Users:lutherfuller:Desktop:TARGET_FOLDER".


Then I could extract the path I need from the error message text.
(And display an intelligent dialog such as: "The disk "OS_X" is not mounted." or "You messed up real bad.")

Hey Luther,

You wrote me off list about GetAliasTarget. I've tried to send a reply 3 times but the posts keep bouncing. Maybe you have some kind of white list that needs to be adjusted?


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
References: 
 >Alias Files (From: Luther Fuller <email@hidden>)
 >Re: Alias Files (From: Neil Laubenthal <email@hidden>)
 >Re: Alias Files (From: KOENIG Yvan <email@hidden>)
 >Re: Alias Files (From: Luther Fuller <email@hidden>)
 >Re: Alias Files (From: KOENIG Yvan <email@hidden>)
 >Re: Alias Files (From: Philip Aker <email@hidden>)
 >Re: Alias Files (From: KOENIG Yvan <email@hidden>)
 >Re: Alias Files (From: Philip Aker <email@hidden>)
 >Re: Alias Files (From: KOENIG Yvan <email@hidden>)
 >Re: Alias Files (From: Philip Aker <email@hidden>)
 >Re: Alias Files (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: AppleScript bug/change/feature in iTunes 7.7.1?
  • Next by Date: Re: AppleScript bug/change/feature in iTunes 7.7.1?
  • Previous by thread: Re: Alias Files
  • Next by thread: Re: Alias Files
  • Index(es):
    • Date
    • Thread