Action
New Draft with Safari Tabs
Use AppleScript to gather all current tabs open in Safari and create a Markdown list in a new draft containing the title and URL of the pages in each tab.
Steps
-
runAppleScript
on execute(draft) set docText to ("## Safari Tabs" & linefeed as string) & linefeed as string tell application "Safari" --Variables set windowCount to number of windows --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 set docText to docText & "- [" & tabName & "](" & tabURL & ")" & linefeed as string end repeat end repeat end tell return docText end execute --stub call to execute for easier testing in Script Editor execute({})
-
script
let d = Draft.create(); d.content = context.appleScriptResponses[0]; d.update(); editor.load(d);
Options
-
After Success Default , Tags: debug Notification Info Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.