|
|
|
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
|
|
|
|