Repository Public Research preview
1-- Print the visible text of a tab.2-- Usage: osascript get-text.applescript <window-id> <tab-index>3on run argv4 set w to (item 1 of argv) as integer5 set t to (item 2 of argv) as integer6 tell application "Safari"7 return do JavaScript "document.body ? document.body.innerText : ''" in tab t of window id w8 end tell9end run10