PDA

View Full Version : help with this apple script


sunilkolluru
08-23-2004, 10:44 PM
this is just a modification of the script that is available in our forums.
what i am trying to do is to have the dialog untill i press close.
so that if i press "esc" key and come into normal screen,
i can again clik "screen" button and go bak to full screen.
i know that i can always drag the movie again ontothe application in the dock to go fullscreen even in the midst of the movie....but trying to get this button thing work. please help me.

on open theMovie
tell application "QuickTime Player"
activate
set num to 1

repeat while (num = 1)

set request to display dialog "clik close button to end" with icon ¬
note buttons {"close", "screen"} default button "screen"
if button returned of request is "screen" then
open theMovie
present movie 1 scale screen
end if
if button returned of request is "close" then
set num to 0
end if
end repeat
end tell
end open

bramley
08-24-2004, 04:32 PM
Is pressing command-F and esc not good enough?

sunilkolluru
08-24-2004, 09:10 PM
i am sorry,

this code (not mine) is to view quicktime movies full screen, when you dont have quicktime pro.

i dont have quick time pro to use "cmd+f" to go fullscreen.

regards..
sunil

roncross@cox.net
08-24-2004, 11:08 PM
set request to display dialog "clik close button to end" with icon

shouldn't it be click, not clik

thx
rlc

sunilkolluru
08-25-2004, 12:16 AM
hi
its just a message in the dialog.
it doesn't matter.



thanks,
sunil

sunilkolluru
08-25-2004, 12:22 AM
usually u used respond with some help ....
where r u?

roncross@cox.net
08-25-2004, 12:48 AM
Send me your email address and I will show you how to view full screen without having quicktime pro

My email address is roncross@cox.net

thx
RLC

bramley
08-25-2004, 02:22 AM
I have QT Player 6.5.1

I open movie, press cmd-F and movie goes to full screen, and starts playing.

Press cmd-1, goes to half-size. Esc reverts to normal, and stops player.

roncross@cox.net
08-25-2004, 02:36 AM
I have the same version and command+f followed by esc doesn't work for me. It sounds like you turned on a pro feature.

thx
RLC

bramley
08-25-2004, 04:23 AM
Wha - hmmm! - it would seem that my player thinks it is the pro version, but shouldn't it say so in the about box?

I think I may need to check who has been buying what for this machine!

Anyway, working with the same commands originally posted by Sunilkolluru, the following does what was requested: -

Click here to open in Script Editor (applescript://com.apple.scripteditor/?action=new&script=on%20open%20%28this_file%29%0D%09tell%20application%20%22QuickTime%20Player%22%20%2D%2Dstart%20QT%0D%09%09activat e%0D%09%09set%20this_movie%20to%20open%20%28this_file%29%20%2D%2Dopen%20movie%0D%09end%20tell%0D%09set%20response%20to%2 0false%0D%09repeat%20until%20response%20%2D%2Dkeep%20going%20until%20close%20button%20is%20pressed%0D%09%09tell%20applic ation%20%22QuickTime%20Player%22%0D%09%09%09if%20%28display%20state%20of%20this_movie%20%3D%20normal%29%20then%20%2D%2Di f%20current%20scale%20is%20not%20full%20screen%20then%20Applescript%20to%20front%20and%20activate%0D%09%09%09%09tell%20m e%0D%09%09%09%09%09activate%0D%09%09%09%09%09set%20request%20to%20display%20dialog%20%22click%20close%20button%20to%20en d%22%20with%20icon%20note%20buttons%20%7B%22close%22%2C%20%22screen%22%7D%20default%20button%20%22screen%22%20%2D%2Dget% 20dialog%0D%09%09%09%09%09if%20button%20returned%20of%20request%20is%20%22screen%22%20then%0D%09%09%09%09%09%09tell%20ap plication%20%22QuickTime%20Player%22%20%2D%2Dif%20screen%20then%20play%20on%20the%20big%20screen%0D%09%09%09%09%09%09%09 activate%0D%09%09%09%09%09%09%09present%20this_movie%20scale%20screen%0D%09%09%09%09%09%09end%20tell%0D%09%09%09%09%09en d%20if%0D%09%09%09%09%09set%20response%20to%20%28button%20returned%20of%20request%20is%20%22close%22%29%20as%20boolean%2 0%2D%2Dif%20close%20then%20stop%20Applescript%0D%09%09%09%09end%20tell%0D%09%09%09end%20if%0D%09%09end%20tell%0D%09end%2 0repeat%0Dend%20open)
on open (this_file)
tell application "QuickTime Player" --start QT
activate
set this_movie to open (this_file) --open movie
end tell
set response to false
repeat until response --keep going until close button is pressed
tell application "QuickTime Player"
if (display state of this_movie = normal) then --if current scale is not full screen then Applescript to front and activate
tell me
activate
set request to display dialog "click close button to end" with icon note buttons {"close", "screen"} default button "screen" --get dialog
if button returned of request is "screen" then
tell application "QuickTime Player" --if screen then play on the big screen
activate
present this_movie scale screen
end tell
end if
set response to (button returned of request is "close") as boolean --if close then stop Applescript
end tell
end if
end tell
end repeat
end open

EDIT: if there are problems try substituting the following line:
if (diplay state of this_movie = normal) then --if current scale is not full screen then Applescript to front and activate

with this one:
if (scale of this_movie = normal) then --if current scale is not full screen then Applescript to front and activate

sunilkolluru
08-25-2004, 06:51 AM
hi bramley,

the code works.
i had to replace "display state" with "screen" as u suggested to make it work.

regardds..
sunil