Page 1 of 1

Extracting References from Apple News

Posted: Wed Oct 02, 2024 6:22 pm
by jpottsx1
Has anyone found a way to extract References using apple script from Apple News publications?

I am looking for a starting point.

Re: Extracting References from Apple News

Posted: Thu Oct 03, 2024 10:21 am
by jpottsx1
I have only been able to get the articles from Apple News into Safari with this crappy little script. Then you can run the script written by by Matthias Steffens.

NOTE: not all Apple News content can be opened in Safari. Some of the content will display/hide the main body of the article when opened in Safari. This dowoesn;t matter since the metadata is still there embedded into the pages code.

Code: Select all

tell application "News"
	activate
	delay 0.5 -- allows time for the app to come to the front
end tell

tell application "System Events"
	tell process "News"
		click menu item "Copy Link" of menu "Edit" of menu bar 1 -- select the "Copy Link" option
	end tell
end tell

delay 1 -- wait for the clipboard contents to be copied

set clipboardContents to (the clipboard as text) -- retrieve clipboard contents

tell application "Safari"
	activate
	delay 0.5
	make new document with properties {URL:clipboardContents} -- open new tab with the clipboard URL
end tell