Is there a way to control MPEG Streamclip with Applescript. I want a script to set in and out points and cut out the section. I can’t find an applescript dictionary. Any advise would be appreciated.
A quick gander with this script:
-- Entire Contents Demo - mini
-- BP ages ago or so
-- This'll get all the controls and structures associated with an App's window and menus
-- In a form which is easily pasteable into your own scripts
-- and show them in the result pane below.
--
-- Copy that into a text editor and change commas to returns to get an easily readable list.
--
-- The script can take a long time if there are LOTS of window items, such as
-- in the "music" pane of iTunes. It may even time out if you have a huge iTunes library
-- The script'll process most App's UI structures in under a minute
set appname to "MPEG Streamclip" -------------------------- Set this to the App you want to look at
set winstuff to "defaultval"
set menustuff to "defaultval"
tell application appname
activate
end tell
tell application "System Events"
tell process appname
set winstuff to entire contents of front window
set menustuff to entire contents of menu bar 1
end tell
end tell
return winstuff & "\r\r\r\r" & menustuff -- comment this out to get just winstuff
return winstuff -- comment this out too to get just menustuff
return menustuff
Yields promising results:
Yup, this script works for me:
tell application "MPEG Streamclip"
activate
end tell
tell application "System Events"
click menu item "Batch List" of menu "List" of menu bar item "List" of menu bar 1 of application process "MPEG Streamclip"
end tell
Additionally, running the first script a second time, while the “Batch list” window is in front yields results for that window:
So it’s quite simple to burrow as deeply as needed into the App’s user interface.
The code is great. My next step is to input a cell from excel into the dialog box “GO TO enter time” The excel sheet makes a time code “minutes:seconds,frames” i.e. 06:23,13 I need to get that into Streamclip.
In Quicktime I can :
tell application “QuickTime Player 7”
activate --allow QT to be run by script
tell document 1 --the active file in QT
set selection start to inValue --INVALUE AND OUTVALUE COME FROM EXCEL IN STREAMCLIP INVALUE,OUTVALUE WOULD BE SOMETHINE LIKE 06:23,13
set selection end to outValue --set in out points
set current time to inValue --show in point
delay 2 --wait show out point
set current time to outValue
end tell
end tell
But Streamclip dosen’t seem to have the variables , and . Is there code to do that or must I use cut and paste keyboard commands that I’ve seen in other applescripts? Something like this
tell application "Finder"
activate
open selection using application file "MPEG Streamclip.app" of folder "Applications" of startup disk
end tell
tell application "MPEG Streamclip" to activate
tell application "System Events"
tell process "MPEG Streamclip"
keystroke "e" using {control down, command down}
delay 1.5
keystroke return
end tell
end tell
The following code brings up the dialog box I need to control with the variable made in excel,
tell application "MPEG Streamclip"
activate
end tell
tell application "System Events"
click menu item "Go to Time." of menu "Edit" of menu bar item "Edit" of menu bar 1 of application process "MPEG Streamclip" of application "System Events"
-- or
--click menu item "Go to In" of menu "Edit" of menu bar item "Edit" of menu bar 1 of application process "MPEG Streamclip" of application "System Events"
--click menu item "Go to Out" of menu "Edit" of menu bar item "Edit" of menu bar 1 of application process "MPEG Streamclip" of application "System Events"
--click menu item "Cut" of menu "Edit" of menu bar item "Edit" of menu bar 1 of application process "MPEG Streamclip" of application "System Events"
end tell
This is a great site and I can’t tell you how much help I’ve received and how much fun I’m having.