PDA

View Full Version : GUI scripting possible with Question Master & Inspire


mistermorris
04-10-2009, 12:26 PM
I've been working for some time on a quick way to create a quiz on Inspire. I used to use ActivStudio's Question Master to quickly, through automation, create a flipchart that could be used with ActiVote. I've now adopted that program for Inspire 1.2.

If anyone is interested, I can share the tricks of the trade. It's tricky though, and not for the feint at heart. The fact of the matter is that Inspire is not set up to be scriptable, and forces us to use GUI scripting.

Here's the starter material that gets the dialog box up:

active application "Inspire"
tell application "System Events"
tell process "Inspire"
click menu item "Question on Current Page..." of menu 1 of menu bar item "Edit" of menu bar 1
end tell
end tell

From there, you have navigate around by using the trick of sending tabs and returns in order to type in whatever stuff you want:

keystroke tab
delay .1
keystroke "answer A here"

The real pain in the butt came when I tried to automate trying to type something into the Question field. Once your cursor is in that field, it captures all tabs and makes navigation impossible, so I used a work-around which can be found on this site:

http://www.macosxhints.com/article.php?story=2008051406323031

What a pain in the butt!

I really wish Inspire was more accessible via Applescript!