<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: DVDplayer code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 21 Aug 2008 16:07:57 GMT</pubDate>
    <description>DZone Snippets: DVDplayer code</description>
    <item>
      <title>Play DVD from Hard Drive Shortcut</title>
      <link>http://snippets.dzone.com/posts/show/1046</link>
      <description>// a quick way to play a DVD that has been saved to the hard drive&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;-- a quick way to play a DVD that has been saved to the hard drive&lt;br /&gt;&lt;br /&gt;-- adapted from a script found in the comments of this article: http://www.macosxhints.com/article.php?story=20050924210643297&lt;br /&gt;&lt;br /&gt;-- Instructions for use:&lt;br /&gt;-- 1. Paste this script into Script Editor and save as an application bundle to ~/Library/Scripts/Applications/Finder/Play DVD Folder&lt;br /&gt;-- 2. Control-click and drag it to the top of a finder window so it appears in every finder window.&lt;br /&gt;-- 3. Next, we'll give our script the DVD Player icon to make it's use more intuitive by entering these commands in Terminal:&lt;br /&gt;--     $ cd ~/Library/Scripts/Applications/Finder/Play\ DVD\ Folder.app/Contents/Resources/&lt;br /&gt;--     $ rm droplet.icns&lt;br /&gt;--     $ cp /Applications/DVD\ Player.app/Contents/Resources/app.icns droplet.icns&lt;br /&gt;--     $ touch ~/Library/Scripts/Applications/Finder/Play\ DVD\ Folder.app&lt;br /&gt;-- 4. In the Finder, drag a DVD Folder onto the "Play DVD Folder at the top of that finder window".&lt;br /&gt;-- 5. Enjoy the movie. :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- script was opened by click in toolbar&lt;br /&gt;on run&lt;br /&gt;	tell application "Finder"&lt;br /&gt;		try&lt;br /&gt;			set currFolder to (folder of the front window as string)&lt;br /&gt;		on error&lt;br /&gt;			display dialog "Error: " &amp; the error_number &amp; ". " &amp; the error_message buttons {"OK"} default button 1&lt;br /&gt;		end try&lt;br /&gt;	end tell&lt;br /&gt;	CD_to(currFolder, false)&lt;br /&gt;end run&lt;br /&gt;&lt;br /&gt;-- script run by draging file/folder to icon&lt;br /&gt;on open (theList)&lt;br /&gt;	set newWindow to false&lt;br /&gt;	repeat with thePath in theList&lt;br /&gt;		set thePath to thePath as string&lt;br /&gt;		if not (thePath ends with ":") then&lt;br /&gt;			set x to the offset of ":" in (the reverse of every character of thePath) as string&lt;br /&gt;			set thePath to (characters 1 thru -(x) of thePath) as string&lt;br /&gt;		end if&lt;br /&gt;		CD_to(thePath, newWindow)&lt;br /&gt;		set newWindow to true -- create window for any other files/folders&lt;br /&gt;	end repeat&lt;br /&gt;	return&lt;br /&gt;end open&lt;br /&gt;&lt;br /&gt;-- open and play the movie&lt;br /&gt;on CD_to(theDir, newWindow)&lt;br /&gt;	try&lt;br /&gt;		tell application "DVD Player"&lt;br /&gt;			activate&lt;br /&gt;			if theDir ends with "VIDEO_TS:" then&lt;br /&gt;				set videoTS to theDir as alias&lt;br /&gt;			else&lt;br /&gt;				set videoTS to theDir &amp; "VIDEO_TS:" as alias&lt;br /&gt;			end if&lt;br /&gt;			open VIDEO_TS videoTS&lt;br /&gt;			set viewer full screen to true&lt;br /&gt;			play dvd&lt;br /&gt;		end tell&lt;br /&gt;	on error the error_message number the error_number&lt;br /&gt;		display dialog "Error: " &amp; the error_number &amp; ". " &amp; the error_message buttons {"OK"} default button 1&lt;br /&gt;	end try&lt;br /&gt;end CD_to&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 03 Jan 2006 12:35:43 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1046</guid>
      <author>SimonDorfman (Simon Dorfman)</author>
    </item>
  </channel>
</rss>
