on run --We get the iTunes's url tell application "Finder" try set ITMS_URL to the clipboard as text on error display dialog "No iTunes URL found in the clipboard. " & Â "Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard" buttons {"Cancel"} end try end tell --We extract de Video_ID of the selected video set AppleScript's text item delimiters to {"videoId="} set VIDEOID to item 2 of (every text item of ITMS_URL) --We tell to Safari open a new Url based in the previous ID, from we get the exact location of the movie set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2" as text tell application "Safari" make new document with properties {URL:UrlBase, visible:false} end tell --We wait 3 seconds while Safari laods the page, if not the script return an error set x to 0 set curd to current date repeat until x = 15 if curd + 3 < (current date) then set x to 15 end repeat --We search in the source code of the page teh reference to the ".mov" file and set it's exactly location tell application "Safari" set codigo to source of front document as text set AppleScript's text item delimiters to {"MovieView autoplay="} set codigo to item 2 of (every text item of codigo) set AppleScript's text item delimiters to {"http://"} set codigo to item 2 of (every text item of codigo) set AppleScript's text item delimiters to {".mov"} set codigo to item 1 of (every text item of codigo) set codigo to "http://" & codigo & ".mov" --Close tab or window created before close front document --Opens the movie in Safari (or default web browser), whre we wait to the load is complete, and then we save it where we want ;) open location codigo end tell end run