Splasm Software Discussions
https://splasm.com/forum/

Batch processing - command line
https://splasm.com/forum/viewtopic.php?f=11&t=2218
Page 1 of 1

Author:  igods [ Wed Nov 04, 2009 11:43 am ]
Post subject:  Batch processing - command line

I'm trying to work out a command line to get ViddyUp to process a file. I've installed CommandRunner in Vuze, and I'm trying to wire up the completed download to ViddyUp's processing. Then I can skip one more manual process.

I've successfully launched ViddyUp and opened a source file with this command:

/Applications/ViddyUp\!\ 1.8.4/ViddyUp\!.app/Contents/MacOS/ViddyUp\! /Volumes/Jester/Users/admin/Movies/mymovie.avi

.. which launches VU, and opens mymovie.avi.

However, I can't figure out how to trigger the processing. (I'd also like to change the Genre, and maybe even Quality).

Is there a command line switch that will engage the processing and perhaps set those 2 parameters?

thanks in advance.

Author:  keithg [ Fri Nov 06, 2009 4:20 pm ]
Post subject:  Re: Batch processing - command line

ViddyUp! doesn't take arguments from the command line and it doesn't officially support AppleScript - but you can use AppleScript to script System Events to automate ViddyUp!'s interface, just like with most Mac OS X apps. Go to the Universal Access preferences in System Preferences and put a checkmark next to "Enable access for assistive devices", then use a tool like UIElementInspector to figure out how to access each interface element in ViddyUp!. Put it together in AppleScript Editor and see what happens.

Here's a quick test I did just to see if I could tell ViddyUp! to open a particular file, modify the Quality and Genre and start processing:

tell application "ViddyUp!"

open "/Users/keithg/Movies/5th element clip.mov"

end tell


tell application "System Events"

set the value of slider 1 of group 1 of window 1 of process "ViddyUp!" to 1 --Quality (Good is 0, Better is 1, Best is 2)

set the value of combo box 1 of group 1 of window 1 of process "ViddyUp!" to "Another Genre"

click button "Process" of group 1 of window 1 of process "ViddyUp!"

end tell


Looks like it works pretty well, unless you have ViddyUp! set to ask for an output location before processing... In your case you'll want to find a way to wire up the path of your latest download as an argument to the script. If you're going to do a lot of this you'll probably want to code a way to wait and dismiss the message that comes up at the end of the process. You can get UIElementInspector at http://developer.apple.com/mac/library/ ... index.html . Good luck!

Author:  igods [ Sat Nov 07, 2009 1:26 pm ]
Post subject:  Re: Batch processing - command line

thanks, Keith, that's awesome information. I didn't realize I could script the UI this way.

say, I haven't quite got the hang of setting the Encoding popup... I tried a lot of variations of this to no avail:

set the menu of menu 1 of pop up button 1 of group 1 of window 1 of process "ViddyUp!" to "Original Encoding"

any ideas?

thanks again, this is really quite cool. not sure if UI scripting is predictable enough to use on my server scripts, but it does a great job of filling in some glue for some of my personal scripting.

thanks for all the helpful info!
cam

Author:  keithg [ Mon Nov 09, 2009 2:52 pm ]
Post subject:  Re: Batch processing - command line

Popup buttons seem a little tricky...try this:

click pop up button 1 of group 1 of window 1 of process "ViddyUp!"

click menu item "Original Encoding" of menu 1 of pop up button 1 of group 1 of window 1 of process "ViddyUp!"

Author:  igods [ Mon Nov 09, 2009 4:26 pm ]
Post subject:  Re: Batch processing - command line

close but no cigar... the final step doesn't work for me:

select menu item "Original Encoding" of menu 1 of pop up button 1 of group 1 of window 1 of process "ViddyUp!"

System Events got an error: Can’t get menu 1 of pop up button 1 of group 1 of window 1 of process "ViddyUp!". Invalid index.

If I drop the menu index, it doesn't crash, but it doesn't change the popup either:

select menu item "Original Encoding" of menu of pop up button 1 of group 1 of window 1 of process "ViddyUp!"

Author:  keithg [ Mon Nov 09, 2009 4:37 pm ]
Post subject:  Re: Batch processing - command line

Try it with "click" instead of "select".

Author:  igods [ Wed Nov 11, 2009 1:41 pm ]
Post subject:  Re: Batch processing - command line

good idea... the click command doesn't blow up, but it doesn't select the item, either. :(

so close. thanks.

Author:  keithg [ Wed Nov 11, 2009 2:41 pm ]
Post subject:  Re: Batch processing - command line

Just tested again to be sure and this is working on my Mac:

tell application "System Events"

click pop up button 1 of group 1 of window 1 of process "ViddyUp!"

click menu item "Original Encoding" of menu 1 of pop up button 1 of group 1 of window 1 of process "ViddyUp!"

end tell

Is that what you have in your test there?

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/