Changing rss feed in Daily Journal - Markdown

HI - First time I’ve tried to modify a template, so I’m probably misunderstanding how it all works. However, I have changed the script - by opening the templates folder, then show package contents, navigating to main.scpt and changing the line in the getNews() function to:

set getNewsSource to download markup from “feed://theguardian.com/uk/rss”

it was previously set to download from nytimes.

However, when I create a new journal, from the menu, it is still created with rss feeds from the NY times.

I can only guess that from the menu I’m triggering the script from some other location - as the one shown in the template location has definitely been changed to get the feed from the Guardian.

Does anyone have any suggestion on what I might be doing wrong?

Did you restart the app? The old script might be still cached. Please note that it’s recommended to customize copies of included scripts/templates to avoid loss of your changes in case of future updates.

Hi - yes, I’ve restarted the app multiple times. Following your suggestion, I made a copy of “Daily Journal - Markdown.templatescriptd” and called it “Alister’s Daily Journal - Markdown.templatescriptd”

I confirmed that the feed in this renamed copy was set to the Guardian’s not the NY times. As before, I deleted the previous journal file for today that had been created - to force the script to create a new one. Having done that, I shut down DTP3 and rebooted my Mac.

I got the same result - it created a journal file with feeds from the NY Times, not the Guardian. Very strange

Some background info - I am on an M1 MacBook Air, running Ventura. I have confirmed that the Guardian RSS feed works by setting it up as a feed in a separate DTP3 database - the feed comes in fine.

Please post the customized source.

Alister’s Daily Journal — Markdown.templatescriptd.zip (27.8 KB)

I’ve zipped the whole thing and attached it here.

1 Like

Running the script from Script Editor uses the Guardian feed.

After this, quitting and relaunching DEVONthink, the Guardian feed is continuing to be used.

Try that @asibbald

Fantastic. Thanks very much. It works perfectly now. I guess there must be layers upon layers of caching going on…

You’re welcome.

I didn’t see any useful result from using DEVONthink 3 > Empty Cache before I ran the script in Script Editor. I also didn’t see any AS property that could be involved.

Our fearless tech leader @cgrunenberg would have to comment further on why this worked, if he has an idea. :slight_smile:

Scripts (including the ones of templates) are cached, that would explain why it works in the Script Editor if the template was already used since launching DEVONthink.

Hello. I trued downloading your modified script and I still get the NY times instead of the Guardian. Did you finally figure out how to get the guardian feed?

Thanks for any help on this

1 Like

You need to completely close DT and then start it up again to flush out caches etc.

@Gerry7

I modified this script some time ago (though the original, not the one posted here) and I came across a similar problem, which may be what’s causing your issue.

The script actually checks to see whether you’ve already run it ‘today’ and it doesn’t run the feeds again if you have (i.e. if there’s already a document with that name in the appropriate group in the database).

So to get it to run again with the new feeds, you have to delete the existing one and empty it from the trash (not sure why, but that’s what I do when I’m testing). This is in addition to cleaning out the caches and restarting DT3, of course.

Perhaps this is what’s happening in your case?

HTH

Thanks… sorry for belated reply

I encountered essentially the same problem. Closing and re-starting DT and rebooting didn’t fix the problem. However, running the script from inside Script Editor did the job. The template is working as expected now. Thanks!