• 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: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
      • From: "Hiroshi T." <email@hidden>
References: 
 >Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)
 >Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: objectspecifiers question (very basic)
  • Next by Date: Re: objectspecifiers question (very basic)
  • Previous by thread: Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
  • Next by thread: Re: Integration of Apple- and Tcl- script (Re: Applescript equivalent of $0 in shell script)
  • Index(es):
    • Date
    • Thread