How to use Applescript to Run RunRev

Emmett Gray film2 at handheldfilm.com
Wed Feb 3 22:20:39 EST 2010


On Wed, 3 Feb 2010 22:07:46 +0100, zryip theSlug 
<zryip.theslug at gmail.com> wrote:
>
>2010/2/3 Emmett Gray <film2 at handheldfilm.com>:
>>  How do you tell Rev to do something useful via applescript?

  Simply specify the stack you need as follows:
>tell application "Revolution" to do script "create card to stack 
>\"TheSlugLab\""
>
Well this gave me confidence that this should be easy. So I tried 
doing something else trivial - just navigating to a card. Bingo. So 
then I R'dTFM. There's a tip at the bottom of the dictionary page on 
"create card" that I missed. It says you need to do this:
   set the defaultStack to "My Stack"
   create card
and lo and behold, it worked as did everything else I added to my 
script. Yay. And thanks for the tip about using backslashes to escape 
the quotes instead of the cumbersome & quote & syntax.

If Rev isn't already running, I couldn't get it to open the stack I 
want to use. So I used the Finder.

tell application "Finder"
	if (exists process "Revolution") is false then
		tell application "Revolution Media" to activate
		delay 2 -- otherwise the freeware nag window stays in front
	end if
	open alias "path:to:myStack"
end tell
tell application "Revolution Media"
	do script "go stack \"myStack\"
	set the defaultStack to \"myStack\"
	create card"
-- etc. etc.
end tell



More information about the use-livecode mailing list