Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to play DVDs from the hard drive' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to play DVDs from the hard drive
Authored by: mark hunte on Jan 07, '06 08:51:01AM
Sorry Forgot to take out the
Say 1 
,
,Say 2
,
Say 3
.. bits in the script.
Just comment them out or remove them. I use them for debugging

---
mh

[ Reply to This | # ]

An AppleScript to play DVDs from the hard drive
Authored by: mark hunte on Jan 07, '06 11:18:03AM
Ok Dumb arse (me) ALSO did not test on more than one folder. just tried to use it and got an error. Thats fixed. in this
 on run
	tell application "Finder"
		try
			set biglist to {}
			set the_doc_folder to path to documents folder --(folder of the front window as string)
			set currFolder to folder "mydvdrips" of the_doc_folder as string
			set thecounter to 0
			repeat count of (every item of folder currFolder whose (class is folder)) times
				
				set thecounter to thecounter + 1
				copy displayed name of (item thecounter of folder currFolder whose (class is folder)) to end of biglist
			end repeat
			set currFolder2 to choose from list biglist with prompt "Choose the Calendar to use" OK button name "Choose" without multiple selections allowed and empty selection allowed
			set currFolder to currFolder & currFolder2 & ":" as string
			
			
		on error
			display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
		end try
	end tell
	
	get currFolder
	CD_to(currFolder, false)
end run

-- script run by draging file/folder to icon
on open (theList)
	set newWindow to false
	repeat with thePath in theList
		set thePath to thePath as string
		if not (thePath ends with ":") then
			set x to the offset of ":" in (the reverse of every character of thePath) as string
			set thePath to (characters 1 thru -(x) of thePath) as string
		end if
		CD_to(thePath, newWindow)
		set newWindow to true -- create window for any other files/folders
	end repeat
	return
end open

-- open and play the movie
on CD_to(theDir, newWindow)
	try
		tell application "DVD Player"
			activate
			if theDir ends with "VIDEO_TS:" then
				set videoTS to theDir as alias
			else
				set videoTS to theDir & "VIDEO_TS:" as alias
			end if
			open VIDEO_TS videoTS
			set viewer full screen to true
			play dvd
		end tell
	on error the error_message number the error_number
		display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
	end try
end CD_to

---
mh

[ Reply to This | # ]