Bug Report: Empty tabs cause AppleScript woes

Newsgator Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Bug Report: Empty tabs cause AppleScript woes Expand / Collapse
Author
Message
Posted 12/4/2005 2:11:15 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 5/24/2006 7:48:00 PM
Posts: 4, Visits: 1
I've been using the "this tab to del.icio.us" script that Ted Leung posted up a while ago, and ran into a little snag; namely, if you have an empty tab, there is no entry whatsoever in the lists returned by "get URLs of tabs" and "get titles of tabs". While this may seem natural, what this amounts to is that "index of selected tab" becomes a lot less useful since there are gaps in the list; if you have selected a tab that comes after the empty one, the position of its URL/title in the lists will be one less than expected.

This is the hunk of script:

tell application "NetNewsWire"
if index of selected tab is 0 then
set delu to (URL of selectedHeadline)
set delt to (title of selectedHeadline)
else
set idx to ((index of selected tab) + 1)
set delu to (item idx of (get URLs of tabs))
set delt to (item idx of (get titles of tabs))
end if
end tell

tell application "System Events"
activate
open location "http://del.icio.us/new/MY_ACCT_NAME?v=2&url=" & delu & "&title=" & delt
end tell
Post #10008
« Prev Topic | Next Topic »


All times are GMT -7:00, Time now is 10:24am

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.063. 8 queries. Compression Disabled.

NewsGator.com | Support | Developers | Partners | Press | Company
© Copyright 2003-2009  NewsGator Technologies, Inc. All Rights Reserved.
Copyright Information | Privacy Policy | Terms of Service
Microsoft Gold Certified Partner