Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Open apps automatically to the left of the main desktop

Hi everyone!


I'm looking for a way to automatically open apps to the left of my main Desktop in OSX El Capitan. The ideal scenario would be to automatically open one of them in this configuration at startup.

Making the app go there every time it's opened is also nice!


I believe it's possible to be achieved using Apple Script, but I couldn't find the necessary blocks around the forums.


Can anyone help with directions to the solution?


Thank you (:

MacBook Pro with Retina display, OS X El Capitan (10.11.4)

Posted on Apr 29, 2016 7:27 AM

Reply
6 replies

Apr 30, 2016 1:24 PM in response to JohnMcSilver

Applescript would just complicate matters (I think GUI scripting would be needed to switch to a specfic desktop), but :

You can have selected applications set to open, whenever you log in to your computer, follow the link :

OS X El Capitan: Open items automatically when you log in

Use Mission Control to add more desktops, if you need them, follow the link :

Use Mission Control on your Mac - Apple Support

And, you can assign an application to a specific desktop, follow the link :

OS X El Capitan: Work in multiple spaces

Apr 30, 2016 5:21 PM in response to balsa2

Hi @balsa2,

Thank you for your response!


I don't believe that solves the question completely, though. I already have apps opening automatically, and the assignment of apps to specific desktops is also nice, which I didn't knew.

But the idea would be to have an application automatically opened as full screen (that is, outside of any desktops), but to the right of the main desktop.


A series of steps in a script at startup would be something as:

Open App -> Make App full screen -> Go to Mission Control -> Move full screen App to the left of the main Desktop -> Go to main Desktop.

May 1, 2016 4:22 PM in response to JohnMcSilver

JohnMcSilver wrote:

A series of steps in a script at startup would be something as:

Open App -> Make App full screen -> Go to Mission Control -> Move full screen App to the left of the main Desktop -> Go to main Desktop.


Hi JohnMcSilver. One option is to use GUI scripting in an AppleScript. Keep in mind GUI scripting can be finicky and unreliable. You can start with the following basic script without error handling. It requires the mouse and keyboard command-line tool Cliclick. Download, open the DMG by double-clicking and drag or copy/paste the binary into /usr/local/bin/. To navigate to the folder in Finder use Command-Shift-G. Use the command cliclick -h in Terminal to get help or run do shell script "usr/local/bin/cliclick -h" in its own script in Script Editor and read the results at the bottom. You can drag a full screen app space in Mission Control to the left of the desktop space. To read the start and end coordinates to use with Cliclick's start a drag (dd:x,y) and end a drag (du:x,y), with an app in full screen mode and Mission Control engaged, you can use Command-Shift-4 to open the screenshot crosshair pointer. Press Esc to exit without taking a screenshot.


(*

script assumes:

no apps are full screen

no other desktops are open

apps don't open full screen

Install Cliclick into usr/local/bin/

key code 3 is the "F" key

key code 126 is the “Up Arrow” key

key code 18 is the “1” key

adjust delays as required

adjust Cliclick coordinates specific to your setup

*)

-- substitute any full screen capable app

tell application "Safari" to activate

delay 4

tell application "System Events"

-- enter app full screen mode

key code 3 using {command down, control down}

delay 3

-- enter Mission Control

key code 126 using control down

end tell

delay 3

-- drag the space Safari occupies to the left

do shell script "usr/local/bin/cliclick dd:830,70 w:1000 du:500,70"

delay 2

tell application "System Events"

-- exit Mission Control

key code 126 using control down

delay 2

-- switch to the desktop (e.g. main/Desktop 1)

key code 18 using control down

end tell

May 1, 2016 4:26 PM in response to Roote

Hi Roote,


Amazing!!! I didn't knew Cliclick existed, it's a great tool.

I tried to use like that (just adjusted the App and the positions, and tried around with delays everywhere I could), but couldn't make it work. It seems that the drag-drop functionality doesn't work as well with the windows in Mission Control.

Also tried to use the "m:500,60" command before "du:.", but it didn't work.


Did it work properly for you? If yes, do you have any idea what may be happening?

I tried to use Mousetools as well, but it didn't work.


Thank you for all the attention and detailed answer!

May 1, 2016 7:01 PM in response to JohnMcSilver

You're right, the drag of a Mission Control space fails in OS X El Capitan. The space darkens at the beginning of the drag indicating that it registers, but the space doesn't slide over. I tested the script in OS X Yosemite where the drag completes successfully. That's why it's always a good idea to state what software versions were used for testing when offering a solution, which for the record is OS X Yosemite 10.10.5, Script Editor 2.7, and AppleScript 2.4. If I find a solution for the issue or can offer a different solution that works for OS X El Capitan I'll post back. Did I mention that GUI scripting can be finicky and unreliable? ;-)

May 2, 2016 4:47 AM in response to Roote

Roote wrote:


You're right, the drag of a Mission Control space fails in OS X El Capitan. The space darkens at the beginning of the drag indicating that it registers, but the space doesn't slide over.

Are you aware of anything in El Capitan that may cause this kind of behaviour?


Since I plan to use the script at startup, I ended up finding the far-from-ideal-but-working solution.

Instead of dragging the App's Desktop to the left, I create another Desktop to the right of the App and delete the previous one. All of that using the positions, so it ended up as:


tell application "Spotify" to activate

delay 1

tell application "System Events"


-- enter app full screen mode


key code 3 using {command down, control down}


delay 1


-- enter Mission Control


key code 126 usingcontrol down

end tell

delay 1

-- creates new desktop and deletes the one on the left

do shell script "usr/local/bin/cliclick c:1650,20 w:1000 m:665,80 w:1500 c:590,25"

tell application "System Events"


-- exit Mission Control


key code 126 usingcontrol down


-- switch to the desktop on the right

do shell script "usr/local/bin/cliclick w:500 c:890,70"

end tell

Still looking to find a better solution! 😀

Open apps automatically to the left of the main desktop

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.