Mac Applescript Play Quicktime

gumby777

macrumors newbie
Original poster
Sep 22, 2007
8
0
Hello. I was wondering if I could have some help with the script that I am building. So far I have all of the code but when I run it and click on a button that should play the movie it doesn't. Could someone help me make quicktime play the specific file and if possible be able to move the location of the file around (so that this will work on multiple computers) thanks for the help and if you want I can send you these movie clips so that this will work for you too!!

set theOptionsM to {"MP - Bridge of Death", "MP - Black Knight).mp4", "MP - Killer Rabbit.mp4", "MP - Knights who say ni.mp4", "MP - Lego.temp.mp4", "MP - Witch.temp.mp4"}
set theOptionsH to {"HG - Babel Fish.temp.mp4", "HG - Dolphin Song.temp.mp4", "HG - no thinking.temp.mp4", "HG - The Ultimate Question.temp.mp4"}
display dialog "Which Movie do you prefer?" buttons ["Montey Python", "Hitchhickers Guide to the Galaxy"]
if button returned of result is "Montey Python" then
tell application "QuickTime Player"
open some item of theOptionsM
display dialog "" buttons ["Quit", "More Montey Python", "Hitchhickers Guide"]
if button returned of result is "Quit" then
ignoring application responses
tell application "QuickTime Player"
quit
end tell
end ignoring
else if button returned of result is "More Montey Python" then
tell application "QuickTime Player"
open some item of theOptionsM
end tell
else if button returned of result is "Hitchhickers Guide" then
tell application "QuickTime Player"
open some item of theOptionsH
end tell
end if
end tell
else if button returned of result is "Hitchhickers Guide to the Galaxy" then
tell application "QuickTime Player"
open some item of theOptionsH
display dialog "" buttons {"Quit", "More Hitchhickers Guide", "Montey Python"}
end tell
end if






I have now made the code changing play to open though then I get the error "QuickTIme Player got an error" the movie could not be opened so what do I need to change so that it will open??
 

hhas

macrumors regular
Oct 15, 2007
126
0
Hello. I was wondering if I could have some help with the script that I am building.
Only if you promise to spell "Monty Python" and "Hitchhiker's Guide" correctly in future, as my brain hurts otherwise.

So far I have all of the code but when I run it and click on a button that should play the movie it doesn't.
If this is a Script Editor applet (as opposed to a Studio application) and it's running on 10.4 or later, save it as an application bundle and put the movie files in the application bundle's 'Resources' folder. You can then use Standard Additions' 'path to resource' command to locate it:

Code:
set fileAlias to path to resource theFileName
tell application "QuickTime Player"
	open fileAlias
	play document 1
end tell
HTH
 
Comment

gumby777

macrumors newbie
Original poster
Sep 22, 2007
8
0
Reply

Sorry about all the bad spelling but I downloaded the files and thats how they were named so instead I just kept the names!
 
Comment

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.