I’m trying to write a script that will download a CSV file from this page but I’m having trouble making it work since the file is not linked as a basic html link but seems to be part of a Javascript table.
For example, the Team Offense tab Javascript looks like this:
Export
I don’t know enough yet about Javascript to be able to write a Do Javascript command that will download the file in the same way should I click the Export option.
I was wondering why this question used 2014 stats and then I noticed it’s an old post. But since I’ve also wanted tables from that same page (albeit for more recent seasons)…
The javascript command that would accomplish this is:
tell application "DEVONthink Pro"
set dul to "https://example.com/page.html"
set this_page to download markup from dul
set cc to create record with {name:"Type", type:html, content:this_page} in parent "ExampleGroup" of database "Example"
end tell
Download pdf:
tell application "DEVONthink Pro"
set npd to create PDF document from "http://example.com/file.pdf" in parent "ExampleGroup" of database "Example"
end tell
NB I’m using devonthink 2 so it is possible that some of the syntax may have changed.
Offhand, I think devonthink has the built-in ability to do routines automatically.