Open unread items from Vienna in your browser
With this script you can open the unread items of a selected feed in Vienna in either Safari (on per tab) or your default browser. Additionally the script will mark all unread items as read in your selected feed.
Open Vienna, select your feed you want to read and run this script. If you're using Safari you'll need to activate "Enable access for assistive devices" in the Universal Access preference pane (if you haven't already done so). If you're using a browser other than safari you can change
openFeedInSafari(theURL)
to
openFeed(theURL)
in line 18.
In order to run this script more elegantly than double-click it from Finder you may prefer to run it from scriptmenu
-
set theArticleURLs to {}
-
-
if UIscript_check() is not false then
-
try
-
tell application "Vienna"
-
activate
-
set theArticleList to article of current folder
-
repeat with anArticle in theArticleList
-
set theURL to link of anArticle
-
if (read of anArticle is not true) then
-
set theArticleURLs to theArticleURLs & theURL
-
end if
-
end repeat
-
mark all read in current folder
-
end tell
-
-
repeat with theURL in theArticleURLs
-
openFeedInSafari(theURL)
-
end repeat
-
on error error_message
-
display dialog error_message
-
end try
-
end if
-
-
on openFeed(anURL)
-
ignoring application responses
-
open location anURL
-
end ignoring
-
end openFeed
-
-
-
on openFeedInSafari(anURL)
-
my new_tab()
-
tell application "Safari"
-
set the URL of document 1 to anURL
-
end tell
-
end openFeedInSafari
-
-
on new_tab()
-
try
-
tell application "Safari"
-
activate
-
end tell
-
tell application "System Events"
-
tell process "Safari"
-
tell menu bar 1
-
tell menu 3
-
click menu item 2
-
end tell
-
end tell
-
end tell
-
end tell
-
on error error_message
-
return error_message
-
end try
-
end new_tab
-
-
-
-
-
-
----Apple User Interface check----------------------------------------
-
-
on UIscript_check()
-
-- get the system version
-
set the hexData to system attribute "sysv"
-
set hexString to {}
-
repeat 4 times
-
set hexString to ((hexData mod 16) as string) & hexString
-
set hexData to hexData div 16
-
end repeat
-
set the OS_version to the hexString as string
-
if the OS_version is less than "1030" then
-
display dialog "This script requires the installation of " & ¬
-
"Mac OS X 10.3 or higher." buttons {"Cancel"} ¬
-
default button 1 with icon 2
-
return false
-
end if
-
-- check to see if assistive devices is enabled
-
tell application "System Events"
-
set UI_enabled to UI elements enabled
-
end tell
-
if UI_enabled is false then
-
tell application "System Preferences"
-
activate
-
set current pane to ¬
-
pane "com.apple.preference.universalaccess"
-
set the dialog_message to "Dieses Script nutzt " & ¬
-
"die eingebaute User Interface Scripting " & ¬
-
"Architektur von Mac OS X, " & ¬
-
"welche momentan deaktiviert ist." & return & return & ¬
-
"Sie können GUI Scripting aktivieren indem Sie " & ¬
-
"die Checkbox “Zugriff für Hilfsgeräte aktivieren” " & ¬
-
"im Bedienungshilfen Einstellungsdialog auswählen."
-
display dialog dialog_message buttons {"Abbrechen"} ¬
-
default button 1 with icon 1
-
end tell
-
return false
-
end if
-
return true
-
end UIscript_check
About this entry
You’re currently reading “Open unread items from Vienna in your browser,” an entry on nesiumdotcom
- Published:
- 09.03.07 / 10pm
- Category:
- Mac, Real World Problems
No comments
Jump to comment form | comments rss [?] | trackback uri [?]