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

POSIX Puzzle


  • Subject: POSIX Puzzle
  • From: "R. Nelson Byrne" <email@hidden>
  • Date: Wed, 11 Jul 2012 11:45:25 -0700

Please, a little help here. I'm confused.
I made this little script which illustrates my concern

------------------------------------------
"/private/var/folders/23/vx0c8c0r8xj82n0059b65rpr0000gn/T/AppleScript Editor.BESFhVT9/logfile.txt" returning logfile

(POSIX file logfile) as alias returning thething
tell application "TextEdit" to open the thething
log ("It works")

tell application "TextEdit" to open ((POSIX file logfile) as alias)
------------------------------------------

When I run it I see this in the Events/Replies window:

------------------------------------------
tell application "TextEdit"
	open alias "Lion:private:var:folders:23:vx0c8c0r8xj82n0059b65rpr0000gn:T:AppleScript Editor.BESFhVT9:logfile.txt"
		--> document "logfile.txt"
end tell
(*It works*)
tell application "TextEdit"
	get POSIX file "/private/var/folders/23/vx0c8c0r8xj82n0059b65rpr0000gn/T/AppleScript Editor.BESFhVT9/logfile.txt"
		--> error number -1728 from POSIX file "/private/var/folders/23/vx0c8c0r8xj82n0059b65rpr0000gn/T/AppleScript Editor.BESFhVT9/logfile.txt"
	open alias "Lion:private:var:folders:23:vx0c8c0r8xj82n0059b65rpr0000gn:T:AppleScript Editor.BESFhVT9:logfile.txt"
		--> document "logfile.txt"
end tell
Result:
document "logfile.txt" of application "TextEdit"

------------------------------------------

OK, it does indeed work, in spite of the error message. TextEdit opens "logfile.txt".

But still, why the error????????


 _______________________________________________
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: POSIX Puzzle
      • From: "koenig.yvan" <email@hidden>
  • Prev by Date: Re:
  • Next by Date: Re: Problem with Converting NSApplescript to Scripting Bridge
  • Previous by thread: class parent page
  • Next by thread: Re: POSIX Puzzle
  • Index(es):
    • Date
    • Thread