I am trying to write an AppleScript to control Orion, a new privacy-focused browser, that will open a new tab in the frontmost window with a specified URL. However, I am getting the result "missing value".
Orion is in beta, and I’m inexperienced with AppleScript, so I can’t tell if the problem is with me or with the browser.
Any help would be appreciated!
What I have now is:
tell application "Orion"
make new tab at window 1 with properties {URL:"https://twitter.com"}
end tell
I have tried variations, listed at the end of this post. Orion does have basic AppleScript support:
Here are the variations I've tried:
tell application "Orion"
tell window 1
make new tab at beginning with properties {URL:"https://twitter.com"}
end tell
end tell
tell application "Orion"
make new tab at end of tabs of window 1 with properties {URL:"https://twitter.com"}
end tell
tell application "Orion" to tell window 1
make new tab with properties {URL:"https://twitter.com"}
end tell
tell application "Orion"
make new document -- maybe this. Creates window
make new tab at end of tabs of window 1 with properties {URL:"https://twitter.com"}
end tell
I've figured this out with the help of the posters at MacScripter. (See https://macscripter.net/viewtopic.php?pid=210524#p210524.)
The Orion beta does have AppleScript oddities and bugs. This is what worked:
tell application "Orion"
tell window index 1
make new tab with properties {URL:"https://twitter.com"}
end tell
end tell
To also switch to the tab, this works:
tell application "Orion"
tell window index 1
make new tab with properties {URL:"https://twitter.com"}
set tabcount to number of tabs
set myTab to tab tabcount
tell myTab
set tabName to its name
end tell
set current tab to first tab whose name is tabName
end tell
end tell