applescript zum abspielen von videos in vlc

Hallo, ich versuche, ein Applescript auszuführen, das den VLC Media Player startet und alle Dateien in einem Ordner abspielt, wenn eine neue Datei hinzugefügt wird. Es schien anfangs gut zu funktionieren, dann habe ich meinen Computer neu gestartet und nicht, es wird nicht ausgeführt. Ich führe das Skript als Ordneraktion aus. siehe beigefügtes Skript. Was vermisse ich?

on adding folder items to theAttachedFolder after receiving theNewItems
-- Get the name of the attached folder

-- Get List of files in folder  
    set the_files to get every file of theAttachedFolder

-- open vlc using files in folder which should result in a vlc playlist 
of all files in folder

    tell application "Finder" to open {the_files} using application 
    file "VLC.app"


end adding folder items to

Jede Hilfe wird sehr geschätzt, ich bin ziemlich neu in diesem Bereich. Danke schön.

Antworten (2)

on adding folder items to this_folder after receiving these_items
    tell application "VLC"
        set thePlaylist to "file:///Users/Smokestack/Desktop/For Vlc" -- substitute with your own actual folder path to the folder action folder following the format “file:///“
        OpenURL thePlaylist
    end tell
end adding folder items to

Sie sollten in der Lage sein, einfach:

tell application "VLC" to play {the_files}