applescript – Faster ways taking me to various work area with old web browser window after opening a brand-new window in present work area

Offered work area 2 has a Chrome window open, the following script when ranged from work area 1 in Shortcuts opens a brand-new window in the present work area (work area 1). The window produced with this script stays in the work area 1. I wish to stay in work area 1.

The following script followed by Open URLs faster way to open some websites opens those websites in this window as anticipated and planned. So work area 2 (or any other work area where an old window of Chrome currently is open) is ending up being active after the Open URLs faster way. If there is an Open App faster way after the Open URLs, the app is opened in work area 2 (where an old window of Chrome is open). So I am transferred to work area 2 after Open URLs following the AppleScript.

If there are no windows open however the Chrome App is, then the window opens in the present work area, loads websites and I stay in the work area because there is no work area with a Chrome window currently open for me to relocate to.

 on run {input, criteria}
inform application "System Occasions"
set chromeIsRunning to exists (procedures where name is "Google Chrome").
end inform.

if chromeIsRunning then.
inform application "Google Chrome".
trigger.
set newWindow to make brand-new window.
set URL of active tab of newWindow to "https://example.com".
end inform.
else.
screen dialog chromeIsRunning.
end if.

return input.
end run.

When there is no Open URLs following the AppleScript, I still am transferred to the various work area.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: