Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

I have an applescript that launches quicktime. It works on Script Editor but not on Mainstage

I have an applescript that launches quicktime. It works on Script Editor but not on Mainstage. When I try to run the Applescript from Mainstage I get a NULL error.

The script simply launches Quicktime and plays a video.

MacBook Pro, OS X Yosemite (10.10.2), Mainstage 3

Posted on Mar 24, 2015 1:54 PM

Reply
2 replies

Mar 24, 2015 2:47 PM in response to Camelot

Sorry, here it goes:


to replaceFrontQTPlayerWithFile(aFile)


tell application "QuickTime Player"


activate


try

set frontDoc to front document


close front document

on error errnumbererrNum

if errNum is -1719 then


-- There is no open document

else if errNum is -10000 then


-- Front doc exists, but does not really...

else


logerr

end if

end try



openaFile


play front document



-- Hide QTP

tell application "System Events"


keystroke "h" usingcommand down

end tell


end tell

end replaceFrontQTPlayerWithFile



on run

set unixFile to "/Users/hareshjhaveri/Movies/SundayBibleSchoolvideos/skitguysGodMasterpiece.mp4 "

set macFile to POSIX fileunixFile

set fileRef to (macFile as alias)

my replaceFrontQTPlayerWithFile(fileRef)

end run


I have an applescript that launches quicktime. It works on Script Editor but not on Mainstage

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.