tell application "Finder"
activate
select window of desktop
select window of desktop
open document file "weddign.mov" of folder "Desktop" of folder "mac" of folder "Users" of startup disk
end tell
tell application "QuickTime Player"
present front movie scale screen
end tell
As we see above, this is for the Quicktime programme to make a movie go full screen. I have a programme called “SWF & FLV Player” that i need to do the same. I have tried replacing above with the relevent programme etc but it comes back with an error "syntax error - Expected end of line but found “front”.
Any ideas?
Hi Denzel,
your script has a very weird syntax.
The Finder is not needed at all to open a QucikTime movie
tell application "QuickTime Player"
open ((path to desktop as Unicode text) & "weddingn.mov")
present front movie scale screen
end tell
Each application has its own dictionary, it is not possible (in almost all cases) just to change the application’s name.
Read the dictionary of “SWF & FLV Player” (if it’s even scriptable) and look if it has a similar present command
Hi, thanks for reply,
ive had it follow my mouse command, then copy and paste!!!
Ive tried reading the dictionary, but it appears greyed out. I have tried to get in contact with the owner company but no reply to what they use. Is there a solution?
Then the application is obviously not scriptable.
If the application has a menu entry to present the movie full screen,
it’s probably possible to do it with GUI scripting
it has the same command (apple + F) thats why i looked input the same as Quicktime.
“it’s probably possible to do it with GUI scripting” - enlighten me on this small fix. ill google it aswell.
try this
activate application "SWF & FLV Player"
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "f" using command down
end tell
end tell
Brilliant, that worked!
The only other thing is that i need to open a file on desktop. What and how do you recommend the path?
If you have a non scriptable application, which can open the document directly, you can use
tell application "Finder" to open ((path to desktop as Unicode text) & "weddingn.mov") using application "SWF & FLV Player"
LOL, i just tried that.
However, the open command doesnt load a playlist. what i need is
file > Load Playlist > playlist.smp. Tried redoobering the code, but no luck.
How do i write the keyboard shortcut command:
Command (apple) + ALT + O ?
I have:
keystroke "o" using command down
to open a document.
Otherwise, i need instead of ‘Open’ is ‘Load Playlist’. But typing this in doesnt work. any ideas?
keystroke "o" using {command down, option down}
Thats good although i dont see a result. How do i open a file from that?
what’s about this
activate application "SWF & FLV Player"
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "o" using {command down, option down}
end tell
end tell
I have:
tell application "SWF & FLV Player"
activate
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "o" using {command down & alt}
end tell
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "f" using command down
end tell
end tell
end tell
end tell
But what i need is:
tell application "SWF & FLV Player"
activate
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "o" using command down & alt
//AND OPEN "PLAYLIST.SMP"
end tell
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "f" using command down
end tell
end tell
end tell
end tell
does that sound right because the command “keystroke “o” using command down & alt” is only a shortcut but it needs to open a specific file.
open is;
tell application “SWF & FLV Player”
Open((“Macintosh HD/Users/Desktop”) & “playlist.smp”)
The open box pops up, but with the "open ((“Macintosh HD/Users/Desktop”) & “playlis.smp”)
after "keystroke “o” using {command down, option down}"doesnt do anything
any ideas?
You have to do the whole thing with GUI scripting
Give this a try (probably you have to play a bit with the delays)
set theFile to POSIX path of (path to desktop) & "playlist.smp"
activate application "SWF & FLV Player"
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "o" using {command down, option down}
delay 0.5
keystroke "G" using command down
delay 0.5
keystroke theFile
delay 0.5
key code 36
delay 0.5
key code 36
delay 1
keystroke "f" using command down
end tell
end tell
thats pretty cool watching that.
what it does now is stop on the ‘Open’ box at the ‘go to folder’ it doesnt press ‘goto’ or ‘open’
this works:
tell application "Finder"
activate
open document file "playlist.smp" of folder "Desktop" of folder "mac" of folder "Users" of startup disk
tell application "System Events"
tell process "SWF & FLV Player"
keystroke "f" using command down
end tell
tell process "SWF & FLV Player"
keystroke "p" using command down
end tell
end tell
end tell
but it goes fullscreen, then back to normal. it doesnt stay there! I have no idea why!!!
I’m sorry, the full screen mode is only available in the Pro version,
so I’m not able to test it
Thats ok, you have been a great hel. I added a delay, then the command. Works a treat now. I had to use the mouse command of click on desktop and open, then the series of commands (fullscreen etc).
Thank you
dean