Re: simple Quictime script
Re: simple Quictime script
- Subject: Re: simple Quictime script
- From: Alex Zavatone <email@hidden>
- Date: Wed, 13 Oct 2010 15:26:48 -0500
Here's how I call a subroutine from within a tell block. The problem is one of scope. We need to refer back to the current script and tell AppleScript that the sub routine you want to run is within the current script or it will think that you want the target of the tell block to try and call the subroutine.
So one way is instead of issuing a tell to another application and then calling the subroutine, use this:
using terms from application "QuickTime Player"
-- do stuff
set myValue to mySubroutine()
end using terms from
The other way to reference the script itself. Near the top of your script put this:
script main
And at the end of your script do this:
end script
Then you can call "main's subfunction()". Like so:
on run {}
Main's Go()
end run
script Main
on Go()
tell application "QuickTime Player"
-- do stuff
set myValue to Main's MySubroutine()
display dialog myValue
end tell
end Go
on MySubroutine()
return "Hi!"
end MySubroutine
end script
_______________________________________________
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