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

Re: posix path argument


  • Subject: Re: posix path argument
  • From: deivy petrescu <email@hidden>
  • Date: Sun, 4 Jun 2006 19:28:22 -0400


On Jun 4, 2006, at 16:21, Nir Soffer wrote:


On 01/06/2006, at 01:28, Nir Soffer wrote:

On 31/05/2006, at 23:09, Nir Soffer wrote:

[how to handle posix path argument]

I found the solution:

set HFSPath to ((POSIX file posixPath) as Unicode text)

I found (thanks Gnarlodious) much nicer solution:

	set aPath to "/foo/bar"
	tell application "TextEdit"
		open my POSIX file aPath
	end tell

Anyone has a clue why you need "my" for "posix file"?

Also, the error you get if you leave out "my" is not very helpful.

Try this code with a path to exiting file:

	set aPath to "/foo/bar"
	tell application "TextEdit"
		open POSIX file aPath
	end tell

You get:

TextEdit got an error: Can't make POSIX file \"/foo/bar\" into type alias.


Instead of something about posix file.


Best Regards,

Nir Soffer


Nir,
I do not know if this should be qualified as a bug or not.
The problem is, "Posix file" is a call to StandardAdditions, and, you are making this call from a "Tell Application" block.
Why does the call never goes through, it is kind of a mystery, since if you send a "beep" call to SA it works.
But the problem is not just with TE, but with most applications.
Using "my" in front of the call one avoids a call to the app in the tell block.
HTH or not...


Deivy


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: posix path argument (From: Nir Soffer <email@hidden>)

  • Prev by Date: Re: posix path argument
  • Next by Date: Re: posix path argument
  • Previous by thread: Re: posix path argument
  • Next by thread: Re: posix path argument
  • Index(es):
    • Date
    • Thread