Re: POSIX Puzzle
Re: POSIX Puzzle
- Subject: Re: POSIX Puzzle
- From: "R. Nelson Byrne" <email@hidden>
- Date: Wed, 11 Jul 2012 14:24:28 -0700
Thanks. That makes perfect sense.
Regards,
Nelson
On Jul 11, 2012, at 12:03 PM, Deivy Petrescu wrote:
> Posix file is a Standard Addition command and not a TextEdit command.
>
> run the following script:
>
> tell application "TextEdit" to display dialog "Here!"
>
> it will work but it will log many errors. Why? Because display dialog is not a TE command but a Standard Addition
>
> On Jul 11, 2012, at 14:45 , "R. Nelson Byrne" <email@hidden> wrote:
>
>> 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
>
> Deivy Petrescu
> email@hidden
> http://www.dicas.com
> Automation for MacOS
>
>
>
_______________________________________________
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: | |
| >POSIX Puzzle (From: "R. Nelson Byrne" <email@hidden>) |