Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

element432

macrumors newbie
Original poster
May 6, 2014
2
0
Hey, I havent used applescript in a few year and I had a small program I am trying to recreate. It basically made a list of several files, that were movies, from a folder on my desktop. It open with a list of the files that were in the folder and you would pick on then it would open it. Im basically have all sorts of issues of where to even start with this now. Any help would be appreciated. The movie format is .mkv. Thanks!
 
Code:
set theExtension to "mkv"
set theFolder to "Macintosh SSD:Users:stevenc:Desktop:my mkvs:" as alias
set theApp to "VLC"

tell application "Finder"
	set file_list to name of every file of theFolder whose name extension is theExtension
end tell

set theFile to item 1 of (choose from list file_list)

tell application theApp to open ((theFolder as string) & theFile)

Im sure theres better ways, but above should do what you asked for

just alter theFolder to reflect path to your particular directory
and alter theApp to whatever mkv player you're using
 
Thanks for your help! Thats basically what I was looking for. It worked great.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.