Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
- Subject: Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
- From: "Hiroshi T." <email@hidden>
- Date: Fri, 27 Oct 2006 23:37:08 +0900
Hello, Philip. Thank you very much for your elaborated and educational
examples.
Your examples run in my 10.3.9 environment.
I understand that Tcl variables can be referred naturally in
Tclapplescript.
I confirmed that Tcl variable '$message' in your example is evaluated
in 'append script {}'
and not in 'execute $script'.
I understand that Tcl variables cannot be set in Tclapplescript.
They must be set by the command substitution '[]'.
You have answered all of my questions in your examples and I'll rewrite
my Expect/Tcl script with Tclapplescript.
With Tclapplescript, I think Expect/Tcl/Tk is one of the most versatile
script languages in OS X.
(I've been a perl-hater...)
On Oct 27, 2006, at 12:50 PM, Philip Aker wrote:
###
package require Tclapplescript
rename AppleScript ascr
set pstate [ascr execute {
set pstate to missing value
tell application "iTunes"
set pstate to get player state
if (pstate is stopped) then
-- many lines of code here
return stopped
end if
end tell
return pstate
}]
set message "\"iTunes state is: $pstate\""
append script {
tell application "Finder"
activate
display dialog }
append script $message
append script { buttons {"OK"} default button "OK" with icon note
end tell
}
ascr execute $script
###
---
H.T.
Any mail that does not come from this mailing list is ignored.
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden