AppleScript support

macOS specific usage questions
OurMovies
New Cone
New Cone
Posts: 2
Joined: 25 Mar 2008 22:56

AppleScript support

Postby OurMovies » 25 Mar 2008 23:05

although as Fkuehne has written in his post (viewtopic.php?f=12&t=43970&start=0&st=0 ... =a#p138523) that the applescript support is "really limited", i wonder if the vlc team is going to do something against that.
he also has written, that adding additional applescript support "should be fairly easy"... is that really the case? where can i find docu about that issue? what should i know/learn? which language (beside applescript itself)? objective-C?

the problem i got: i am writing a java application (for those who are interested: http://omov.sourceforge.net) which interacts with vlc via applescript. currently i am of need of the following features:
- determine if vlc is playing (because invoking the play command stops vlc if its running)
- select a certain item in the list (i added an element and want to play it, but if there are already items in the playlist, the topmost item will be played/stopped, depending on vlc's state)

ptilol
New Cone
New Cone
Posts: 1
Joined: 09 Apr 2008 23:52

Re: AppleScript support

Postby ptilol » 09 Apr 2008 23:58

If you can't wait for the promised rewrite of the applescript library, you can use this hack:

Prerequisite: Enable the Web interface of VLC.

Applescript:

Code: Select all

set vlcState to (do shell script "curl -s http://localhost:8080/requests/status.xml | grep '<state>' | cut -f2 -d'>' | cut -f1 -d'<'")
in the vlcState variable, you obtain "stop", "paused" or "playing". If VLC does not run, it will be an empty string.

Note that hacking around the HTTP interface of VLC actually open a huge lot of possibilities.

Enjoy automating!

OurMovies
New Cone
New Cone
Posts: 2
Joined: 25 Mar 2008 22:56

Re: AppleScript support

Postby OurMovies » 22 Apr 2008 21:34

hm... nice, did not know of this web interface thing.
there is even a possibility from read the current playlist.

i think i am going to code some layer above this web interface -hopefully this "kind of api" is stable...

THANKS for the tip, helped a lot!

tecpunk
New Cone
New Cone
Posts: 1
Joined: 21 Feb 2011 06:51

Re: AppleScript support

Postby tecpunk » 21 Feb 2011 06:56

tell application "Terminal"
do script "/Applications/VLC.app/Contents/MacOS/VLC --extraintf=http"
end tell


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 34 guests