-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/11/15 20:00
# dMod: 2016/11/15 20:04
# Appl: Safari & Downie
# Task: Send URL of front Safari document to Downie for processing.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Send, @Safari, @URL, @Downie, @Processing
-------------------------------------------------------------------------------------------
set theURL to safariURL()
if theURL ≠ false then
tell application "Downie"
activate
open all URLs in text theURL
end tell
else
display notification "No Viable URLs were Found!" with title "Downie Video Downloader" subtitle "·········································" sound name "Tink"
end if
-------------------------------------------------------------------------------------------
--» HANDLERS
-------------------------------------------------------------------------------------------
on safariURL()
tell application "Safari"
try
if front document exists then
tell front document
set _url to its URL
try
_url
on error
set _url to false
end try
end tell
else
set _url to false
end if
return _url
on error
error "Failure in safariURL() handler of Internet Library."
end try
end tell
end safariURL
-------------------------------------------------------------------------------------------