• 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: POSIX path with osascript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX path with osascript


  • Subject: Re: POSIX path with osascript
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 28 Jan 2010 11:27:46 +0100

Le 27 janv. 2010 à 22:39:47, Matthew Smith a écrit :

> Then the line should be:
>
> set FileAlias to POSIX file (FolderPath & "/" & FileName)
>
> POSIX path returns the posix path of an alias. POSIX file takes a string that is the POSIX  path and returns an alias.
>
> Matthew Smith

Hello Matthew,

It sure has been a typo, but it could anyway be worth to clear up any confusion.

Running this script in AppleScript Editor:

	-- Let's have the full posix path to a file that should exist on any box
	set SysLogPPath to "/var/log/system.log"
	log SysLogPPath
	log class of SysLogPPath
	-- Let's get an AppleScript file reference to that file
	set SysLogFRef to POSIX file SysLogPPath
	log SysLogFRef
	log class of SysLogFRef
	-- Let's get an AppleScript alias reference to that file
	set SysLogAlias to SysLogFRef as alias
	log SysLogAlias
	log class of SysLogAlias

and looking at the log one gets (my startup disk is named "Boot"):

	(*/var/log/system.log*)
	(*text*)
	(*file Boot:private:var:log:system.log*)
	(*«class furl»*)
	(*alias Boot:private:var:log:system.log*)
	(*alias*)

It thus appears that "POSIX file" yields a file reference, not an alias.
And that a file is not an alias.

Even if file and alias references often are interchangeable, this is not always the case, and ignoring the fact may render some error conditions plain unintelligible.

HTH,
Axel


 _______________________________________________
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: 
 >Re: POSIX path with osascript (From: Jay Louvion <email@hidden>)
 >Re: POSIX path with osascript (From: Matthew Smith <email@hidden>)

  • Prev by Date: Re: URL Access Scripting file size limitations? (Leopard)
  • Next by Date: Re: Send outgoing message error from Mail.app
  • Previous by thread: Re: POSIX path with osascript
  • Next by thread: Re: POSIX path with osascript
  • Index(es):
    • Date
    • Thread