RSS Refresh w. Applescript?

Does anyone have an applescript they can share that refreshes their RSS feeds?

I’m looking for an easy way to manually refresh several RSS feeds at a time. I understand they can be scheduled to refresh through DEVONthink’s preferences at various intervals, or individually selected and refreshed through the menu. However, I was hoping to create a script that I could just throw in the toolbar that would manually refresh all of the feeds that I have set up in DEVONthink. So, just to be clear, my feeds are set up correctly and downloading items at the appropriate interval set in DEVONthink’s preferences, but I’d like to use an applescript to refresh them without clicking around (i.e., regardless of whether I’ve selected the RSS feeds, etc.).

Over the years, there have been several posts in this forum about the issue. However, I have not been able to locate any with examples that use DEVONthink’s refresh command - which appears to be relatively new. I’ve included a screenshot below from the applescript library.

Could anyone share an example of an applescript they use with this command? I understand that the examples are likely to be specific to your working environment (e.g., how they’re grouped, tagged, etc.).

As you can probably tell from this post, I’m new to DEVONthink and, to put it generously, a novice applescripter. However, I am pretty good a reverse engineering things from examples!

Also, if this isn’t the appropriate applescript command, what do others use?

Thanks for any help you can lend!

Here is a very simple teaching edition version…

tell application id "DNtp"
	set rss01 to get record at "/Web/Files/DEVONtechnologies Community - Latest topics" in database "File Types"
	set rss02 to get record at "40Tech" in database "iOS Sync Test"
	
	refresh record rss01
	refresh record rss02
	
end tell

Again, this is for education and not optimized in loops, etc. but it covers the essence of the request and is fully functional.

3 Likes

This is perfect @BLUEFROG! Thank you so much!!

You’re very welcome!
I hope it encourages you to explore even more Cheers! :slight_smile:

1 Like

@BLUEFROG I’ve really enjoyed using DT3 as an RSS reader over these last few week; Thanks for your script above!

Quick follow up question: when the AppleScript refreshes a record, where does it get its settings for the record’s formatting?

I ask because I’ve noticed some weird behavior - only on occasion - where a new post will be downloaded as a “web internet location”, as opposed to a clutter-free formatted note (which is what I have setup in my system preferences for RSS feeds). I just wanted to rule out that the format of the RSS feed was not something that I should also specify in the Applescript. Otherwise, it seems like there might be a bug with how DT3 handles RSS preferences.

Thanks again for all of your help!

I wouldn’t assume it’s a bug. It’s possible there was an issue creating the file from the resource and a bookmark was created as a fallback (which is a built-in mechanism, so you’ll end up with something in the event of an error).

What feed URL and RSS Prefs do you have set?

@BLUEFROG Thanks for getting back to me! So, it sounds like you’re saying that the settings should come from DT3’s RSS preferences, right (unless there’s an error, etc.)?

As always, you’re correct that it must have been created as a fallback, as I noticed that the two posts from this morning were listed in my Log file (and that a bookmark was created). Oddly enough, I don’t see any of the other times listed, however.

My RSS preferences are set to the following:

  • Check for Updates: Every 30 Minutes
  • Remove Articles: Manually
  • Feed Format: Formatted Note (w. “Use clutter-free layout” checked)
  • Feed Style Sheet: Default.css

These have been my settings for the last few weeks, but prior to adopting them, I tried to set the “Check for Updates” option to “Manually”, thinking that I could just use your fantastic script. However, I noticed that when I did that, this problem always occurred (i.e., the feed downloaded as a bookmark and did not follow my “Feed Format” preferences). In any event, it still occurs occasionally with the settings listed above, too.

I’ve noticed it with all of my feeds at some point or another, but if you want to take a look at one from this morning, here’s one:

Thanks again!

The refreshing of the feeds via DEVONthink is certainly using some different mechanisms than the simple AppleScript approach. Development may have some more insight into the technical aspects of it, but the script would be suspectible to server responses and network fluctations and that could cause the fallback condition.

@BLUEFROG Got it! Thanks!!

As an uninitiated DT3 newbie, apologies for the following stupid question: Is there someone from development that I should send this to? Or do they regularly read these things? Just wanted to to make sure to pass things through the usual channels. Thanks!

Out of curiosity, is there a way to specify formatting options in the RSS AppleScript itself (e.g., formatted note, clutter-free layout)? Or does that have to come from DEVONthink’s preferences?

Thanks again!

The forums are fine for this kind of inquiry and yes, we all read through posts and send them to each other on occasion.

From Help > Documentation > Documents > HTML-based Formats > Formatted Notes and HTML