MacOS – AppleScript To Manipulate VLC

applescripterrormacosscriptvlc

I want to do a script, that it can launch VLC player, and in VLC player "Open a file", then
"Select a folder", then click on "add" then "play" it. I think that Automator can't do this. But Applescript seems legit, right?

How to build an easy script, that I can save as an application then setup it to the startup folder?

Path : the folder in question /Users/server_raagc/Copy

(I tried automator, then applescript, then terminal with a .plist then another automator combined with an applescript saved as application, all of this in a different way times 36.

My code :

set workflowpath to "/Users/server_raagc/Desktop/FINAAAAAL - copie.workflow" 
set qtdworkflowpath to quoted form of (POSIX path of workflowpath) 
set command to "/usr/bin/automator " & qtdworkflowpath 
set output to do shell script command 

Always an error. Or here trying to code another one. Same thing.

 activate application "VLC"
 tell application "System Events"
keystroke "O" using command down
 end tell
 tell application "System Events" to tell process "VLC"
click button "Parcourir..." of window 1 of window 2
 end tell

The automator Test:
Maybe becauce one is an "Watch Me do"?

image desc

Best Answer

This AppleScript will open the specified folder in VLC and begin to play the contents:

tell application "VLC"
  OpenURL "file:///Users/grgarside/Desktop/test/"
  play
end tell