Export Flagged Items?

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



Export Flagged Items? Expand / Collapse
Author
Message
Posted 11/11/2005 1:02:45 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 7/10/2006 7:39:00 PM
Posts: 1, Visits: 1
It would be great to be able to extract flagged items (the URI and perhaps even the content) so that I can keep them for future reference (or to perhaps really clean out my growing NNW cache without fear of failure/loss).

I suspect there are other ways to achieve something like this too.

Anyone?
Post #9558
Posted 11/11/2005 7:10:54 PM
NewsGator

NewsGator

Group: Administrators
Last Login: Yesterday @ 6:23:45 PM
Posts: 1,090, Visits: 2,039
You could probably write an AppleScript script that exports flagged items as HTML (or whatever format you like).

Though I don't know of an existing script that does that, you might find some of the scripts on this page make good examples:

http://ranchero.com/netnewswire/resources/scripts.php
Post #9568
Posted 11/29/2005 2:35:21 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 3/26/2006 5:17:00 AM
Posts: 5, Visits: 1
Here's a quickly composed AppleScript script that will export flagged items to a text file (on the desktop, named "NNW Flagged Items.txt"). CAUTION: The script will overwrite (destroy) any file of the same name if it is in the desktop folder. The script has been tested minimally and should be considered only as a starting point. While I don't think that there's much that will go wrong, other than the warning above, USE AT YOUR OWN RISK.

Note: The script will provide the URL, if available, and the description, if available, of each flagged item. The description will be in its raw format (html tags and all of that ugly stuff).

-- Begin Code --
set content_ to ""
set desc_ to ""
set url_ to ""

tell application "NetNewsWire"
set subs_count to count subscriptions
repeat with i from 1 to subs_count
set hl_count to count headlines of subscription i
repeat with x from 1 to hl_count
if isFlagged of headline x of subscription i is true then
tell headline x of subscription i
try
set desc_ to "Description: " & description
on error
set desc_ to "Description: Not Available"
end try

try
set url_ to "URL: " & URL
on error
set url_ to "URL: Not Available"
end try

set content_ to content_ & ¬
("----------------------------" & ¬
return & url_ & return & desc_ & ¬
return & return)

set desc_ to ""
set url_ to ""
end tell
end if
end repeat
end repeat
end tell

write_to_file(content_, (path to desktop as text) & "NNW Flagged Items.txt", false)

to write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as text
set the open_target_file to ¬
open for access file target_file with write permission
if append_data is false then ¬
set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
close access file target_file
end try
return false
end try
end write_to_file
-- End Code --

I hope it's useful/helpful.

-- Rob

Post #9933
Posted 11/29/2005 5:28:27 PM
NewsGator

NewsGator

Group: Administrators
Last Login: Yesterday @ 6:23:45 PM
Posts: 1,090, Visits: 2,039
Thanks, Rob! Very cool.
Post #9940
Posted 11/30/2005 7:58:51 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 3/26/2006 5:17:00 AM
Posts: 5, Visits: 1
From the "For what it's worth" category...

1. The script can be used as a special subscription in NNW (File>New Special Subscription>Script...). While it won't display anything in NNW, it will run each time a refresh is executed, providing a somewhat automated export of flagged items.

2. The script can append data to an existing export file or it can overwrite the content of an existing file. To change the behavior, modify the last parameter, in the call to the file writing handler, to true (append) or false (don't append).

-- Rob
Post #9955
« Prev Topic | Next Topic »


All times are GMT -7:00, Time now is 7:41pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.437. 9 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