andywalt Posted November 7, 2021 Share Posted November 7, 2021 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 Link to comment
deanishe Posted November 8, 2021 Share Posted November 8, 2021 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now