Jump to content

Chaining using Chrome to open multiple windows then have Magnet app place them


Recommended Posts

I used a wide screen monitor and want to be able to type a keyword and it open two separate windows that I can then use either the Magnet app's hotkeys to make them fit to the left and right halves of the screen respectively.

 

I have the hotkeys for the Magnet app set to the corresponding Key Combo but they aren't triggering appropriately.

 

The div app, works similarly but I'm struggling with chaining the processes one after another. I'd be happy to use either process (Magnet with hotkeys or triggering Div after a window launch) but just trying to learn more.

 

https://magnet.crowdcafe.com/

 

https://github.com/pawelgrzybek/div

 

My first NSAppleScript is:

on alfred_script(q)
    tell application "Google Chrome"
        make new window
        open location "http://www.blank.org/"
    end tell
end alfred_script

 

and the second is:

on alfred_script(q)
    tell application "Google Chrome"
        make new window
        open location "https://bigassmessage.com/"
    end tell
end alfred_script

Screen Shot 2021-11-07 at 12.42.16 AM.png

Link to comment
22 hours ago, andywalt said:

but they aren't triggering appropriately

 

What do you mean? "Not appropriately" isn't a good description of what's going wrong.

 

At a guess, I'd say you need to add some short delays between your actions to give the applications you're firing keystrokes at enough time to react before the next one.

 

22 hours ago, andywalt said:

My first NSAppleScript is

 

Don't use Run NSAppleScript. Use a regular Run Script with Language = "/usr/bin/osascript (AppleScript)". Run NSAppleScript behaves unpredictably. Replacing it with a Run Script fixes a lot of non-working AppleScripts.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...