• 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: Sun, 3 Aug 2008 07:34:41 -0700

On 2008-08-03, at 02:03:27 , KOENIG Yvan wrote:

So I created version 1.0.1 of GetAliasTarget which uses those old style functions. So if you can verify that you get the HFS path using version 1.0.1, I think everyone should file a bug because then there's some proof that it can be done.



Bingo.

With this script:

tell application "Finder"
set thePath to (the clipboard as «class furl») as text
set class_of_item to class of item thePath
if class_of_item is alias file then
try
set originalPath to original item of item thePath as text (* send an error if the original file is not inline *)
on error
set originalPath to do shell script "/usr/local/bin/ GetAliasTarget " & quoted form of POSIX path of thePath
end try
else
set originalPath to thePath
end if
end tell


display dialog originalPath

and the new GetAliasTarget

I get the Posix path of an alias whose original file is on a missing volume.

Here is the log.

tell application "Finder"
the clipboard as «class furl»
file "Macintosh HD:Users:yvan_koenig:Desktop:pour_modifier_Numbers.zip"
get class of item "Macintosh HD:Users:yvan_koenig:Desktop:pour_modifier_Numbers.zip"
alias file
get original item of item "Macintosh HD:Users:yvan_koenig:Desktop:pour_modifier_Numbers.zip"
do shell script "/usr/local/bin/GetAliasTarget '/Users/yvan_koenig/ Desktop/pour_modifier_Numbers.zip'" "/Volumes/Sans titre/ pour_modifier_Numbers.zip"
end tell
tell current application
display dialog "/Volumes/Sans titre/ pour_modifier_Numbers.zip" {button returned:"OK"}
end tell


I am not sufficiently fluent with English to send a correct bug report for such a thing :-(

What you have included in this post would be fine for a bug filed on Finder scripting. I have sent a post to one of the Finder developers informing him of the problem.


Since the new alias storage format worked for me both on 10.4 and 10.5 I'm wondering if you created those aliases back in 10.3 or earlier or with a tool that stored those aliases in the old format? That could be a factor in this problem.

PS: This GetAliasTarget tool is currently not guaranteed to give you a correct trailing colon for aliases which target folders. That's something you may have to watch out for in scripting code.


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: Alias Files
      • From: Luther Fuller <email@hidden>
    • Re: Alias Files
      • From: KOENIG Yvan <email@hidden>
    • Re: Alias Files
      • From: KOENIG Yvan <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>)

  • Prev by Date: Photoshop CS3 : translate selection problem - possibly units?
  • Next by Date: Re: Alias Files
  • Previous by thread: Re: Alias Files
  • Next by thread: Re: Alias Files
  • Index(es):
    • Date
    • Thread