Extracting References from Apple News

Users asking other users for AppleScripts that work with Bookends.
Post Reply
jpottsx1
Posts: 4
Joined: Sun Sep 29, 2024 9:56 am

Extracting References from Apple News

Post by jpottsx1 »

Has anyone found a way to extract References using apple script from Apple News publications?

I am looking for a starting point.
jpottsx1
Posts: 4
Joined: Sun Sep 29, 2024 9:56 am

Re: Extracting References from Apple News

Post 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
Post Reply