POSIX Puzzle
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