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

Re: symlinks


  • Subject: Re: symlinks
  • From: KOENIG Yvan <email@hidden>
  • Date: Fri, 13 Aug 2010 23:47:19 +0200


Le 13 août 2010 à 23:36, Luther Fuller a écrit :

On Aug 12, 2010, at 5:16 PM, Emmanuel LEVY wrote:

set f to "/Users/emmanuel/Desktop/fred/"
set actualfolder to posix path of (f as alias) -- may be /Volumes/ Library-1/etc
set somepath to actualfolder & "some/path/to/some/item"
read posix file somepath

I'm having a problem with (f as alias) where f is clearly a posix path.
(Emmanuel, did you get any error with (f as alias)?)
I have never had any trouble converting an alias to a posix path for use in a 'do shell script ...'.
This afternoon, I have been trying to convert a valid posix path to an alias.
This seems to be impossible.


A search turned up this recent remark:
On 10/07/2010, at 9:55 PM, Shane Stanley wrote:

For some reason can't use "POSIX file" in a specifier -- you have to coerce:

set hfsPath to (((POSIXPath as text) as POSIX file) as text)

After experimenting with this for awhile, I found that 'hfsPath' isn't really an hfs path.
I've broken the example into steps, as follows:


alias "OS_X:Users:lutherfuller:Desktop:symlink Testing:TEST-FOLDER"
set posixPath to (quoted form of (POSIX path of the result))
posixPath as text --> '/Users/lutherfuller/Desktop/symlink Testing/ TEST-FOLDER/'
the result as POSIX file --> file ":':Users:lutherfuller:Desktop:symlink Testing:TEST-FOLDER:'"
the result as text --> :':Users:lutherfuller:Desktop:symlink Testing:TEST-FOLDER:'
the result as alias --> Error: file :':Users:lutherfuller:Desktop:symlink Testing:TEST-FOLDER:' wasn't found.
log the result


Surely, there is a simple way to convert a valid posix path to an alias, but I haven't found it yet.
In other words, (f as alias) always errors ... at least for me!

set le_chemin to "" & (path to desktop) & "CDpourMuriel.txt" set validPOSIXpath to POSIX path of file le_chemin tell application "System Events" set hfsPath to path of disk item validPOSIXpath end tell set hfsAlias to hfsPath as alias

Yvan KOENIG (VALLAURIS, France) vendredi 13 août 2010 23:46:57




_______________________________________________ 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: 
 >symlinks (From: Luther Fuller <email@hidden>)
 >Re: symlinks (From: Emmanuel LEVY <email@hidden>)
 >Re: symlinks (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: symlinks
  • Next by Date: Re: How to speed up execution time of this script
  • Previous by thread: Re: symlinks
  • Next by thread: Re: symlinks
  • Index(es):
    • Date
    • Thread