…asked a user in yesterday’s meet-up. As suspected the answer was AppleScript. I knocked this up after the meet and am happy to say it works (paste code into your Script Editor†):
-- ~~~~START CODE~~~~
-- created/tested in script Debugger v8.0.1 on macOS 10.14.6
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Safari"
--Variables
set windowCount to number of windows
set docText to ""
--Repeat for Every Window
repeat with x from 1 to windowCount
set tabcount to number of tabs in window x
--Repeat for Every Tab in Current Window
repeat with y from 1 to tabcount
--Get Tab Name & URL
set tabName to name of tab y of window x
set tabURL to URL of tab y of window x
my makeNote(tabName, tabURL)
end repeat
end repeat
end tell
try
set dialogAnswer to display dialog ¬
"Data is now copied to the current Tinderbox document." buttons {"OK"} ¬
default button "OK"
end try
--Write Document Text
on makeNote(tabName, tabURL)
tell application "Tinderbox 9"
tell front document
set myNote to make new note
set name of myNote to tabName
set value of (attribute of myNote named "URL") to tabURL
set value of (attribute of myNote named "DisplayedAttributes") to "URL"
--set text of myNote to tabURL
end tell
end tell
end makeNote
-- ~~~~END CODE~~~~
The user (not IIRC a forum member) has 1,67 Safari tabs open ( I can’t even… ) but I’m happy to report the above worked and there is now a TBX with 1,061 new notes with each note’s $Name set from the tab title (i.e. the HTML <title>
value) and the source URL set in $URL and shown as a Displayed Attribute.
Note: most (all?) Tinderbox-supported macOS version will likely ask permission to access Safari and/or Tinderbox; you will need to allow this for the script to work.
FWIW, why so many tabs open?. Do lots of Zoom meeting where people put useful links in the chat? If you open each as a new browser tab, they can mount up.
Some observations:
- this is a quick-and-dirty script to get the job done. it makes notes in the current container of the front Tinderbox document. It doesn’t check Tinderbox is open, or if a doc it open etc.
- if using the same doc to add new such notes, I’d make a prototype for new notes and set that $Prototype value rather than setting $DisplayedAttributes.
- if using this a lot, consider using Apple’s Automator app to make a service for ‘clipping’ the data to Tinderbox. You could even get Safari to close the tab once done - especially if it is only open to ‘remember’ the title/URL of the recommendation.
- I’ve only experimented with safari, but I’d suspect similar is possible for Chrome or Firefox.
HTH
†. Found in Applications ▸ Utilities ▸ Script Editor