Saturday, October 5, 2024

keyboard – Open a brand new workspace in OSX with out utilizing the mouse

I’m used to Linux environments however I’ve to make use of a Mac for work. Now I’m questioning why it appears to be not possible to open new workspaces in OSX with out utilizing the mouse? I understand how to change between them or transfer home windows in several workspaces, when they’re already open, however there appears no technique to open or shut a workspace simply by keyboard shortcuts. I’m already utilizing Amethyst however it appears to not assist with this downside. Does anyone know an answer?

I already tried utilizing an AppleScript, that I discovered in one other thread. But it surely does not work since, Mission Management just isn’t out there as an utility within the present OSX.

Consumer
inform utility "System Occasions"
    do shell script "/Functions/Mission Management.app/Contents/MacOS/Mission Management"
    inform course of "Dock"
        set countDesktops to depend buttons of listing 1 of group 1
        --new desktop
        click on button 1 of group 1
        --switch to new desktop
        repeat till (depend buttons of listing 1 of group 1) = (countDesktops + 1)
        finish repeat
        click on button (countDesktops + 1) of listing 1 of group 1
    finish inform
finish inform

I requested ChatGPT to regulate it and this got here out:

inform utility "System Occasions"
    -- This is able to be the place you'd simulate opening Mission Management, 
    -- however since we will not instantly do "Management + Up Arrow", we'd take into account different strategies 
    -- or handbook activation earlier than working the script.
    inform course of "Dock"
        set countDesktops to depend buttons of listing 1 of group 1
        -- Assuming Mission Management is already open, try and create a brand new desktop
        click on button 1 of group 1
        delay 1 -- Look forward to the animation to finish; regulate delay as vital
        -- Try to change to the brand new desktop, assuming it has been created
        set newCountDesktops to depend buttons of listing 1 of group 1
        if newCountDesktops > countDesktops then
            click on button newCountDesktops of listing 1 of group 1
        finish if
    finish inform
finish inform

I saved it as an AppleScript in Automator and assigned a hotkey to it. After I now open mission management manually and press my assigned hotkeys, nothing occurs.

How might I debug this?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles