Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6174173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:42:23+00:00 2026-05-23T23:42:23+00:00

I’m trying to figure out how to get the current space # from mission

  • 0

I’m trying to figure out how to get the current space # from mission control. Source would be helpful, but more helpful would be info on how to figure this out myself. I’ve written a few applescripts, but more often than not it seems like any time I need to do something new (that I can’t find dictionary documentation for) it falls under the category of "tell this specific app (e.g. "System Events") this very specific thing" and I’ve no clue how I would actually figure that out.


Specifically what I am trying to do:

I hate the new mission control in OSX 10.7. I want my spaces "grid" back since I used it all the time. I used to navigate between spaces using arrow keys (e.g. ALT+↑) every few seconds. Now I’m stuck with this clunky 1×9 array of spaces instead of an elegant 3×3 grid. I’ve re-mapped all my spaces to use the number pad, which partially takes care of the problem (since it is a 3×3 grid), but only when I have an external keyboard attached.

Basically, I want to be able to use ALT+↑ and ↓ again, but to do so I need to detect the current space # so that I can switch from space 5–>2, for example.

Dave’s answer below, although far more detailed than I expected, requires writing an app to do this (plus it still doesn’t fully answer the question). If it’s at all possible, I’d rather just bind a few keys to an applescript.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:42:23+00:00Added an answer on May 23, 2026 at 11:42 pm

    I’m trying to figure this out myself. Not there yet, but in the right direction:

    • Each Mission Control “space” gets a uuid assigned to it…
    • …except for the very first one (AFAIK), and the Dashboard one.

    You can read them here:

    $ defaults read com.apple.spaces
    $ defaults read com.apple.desktop
    

    File locations:

    ~/Library/Preferences/com.apple.spaces.plist
    ~/Library/Preferences/com.apple.desktop.plist
    

    Here’s mine. I have four spaces enabled, and three entries show up:

    $ defaults read com.apple.spaces
    {
        spaces =     (
                    {
                type = 0; 
                uuid = "9F552977-3DB0-43E5-8753-E45AC4C61973";
            },
                    {
                type = 0;
                uuid = "44C8072A-7DC9-4E83-94DD-BDEAF333C924";
            },
                    {
                type = 0;
                uuid = "6FADBDFE-4CE8-4FC9-B535-40D7CC3C4C58";
            }
        );
    }
    

    If you delete a space, that entry will get removed from the file. If you add a space, an entry will be added. Again, there’s never an entry for Desktop 1 or Dashboard.

    I’m not sure if there’s a public API to figure out what space uuid is being displayed on a display. I’d assume that no uuid means Display 1, and the others’ mean Display 1+n.

    I took a quick glance through the AppleScript Editor Library (Window —> Library) and didn’t see any entries under System Events for spaces. This is probably something that can be done with Cocoa, perhaps via private API, but I’m not sure about AppleScript.


    UPDATE – July 23, 2011

    It looks like Dock controls Mission Control. You can grab its header files like so:

    1. Go to: /System/Library/CoreServices/Dock
    2. Right-Click and Show Package Contents
    3. Navigate: /Contents/MacOS/
    4. Copy and paste the Dock binary to your desktop.
    5. Run: $class-dump ~/Desktop/Dock

    That’ll spit out all of its header files (it’s long; almost 7,500 lines). You can see the spaceUUID strings appearing in there. There’s a class called WVSpace which appears to represent a single Space in Mission Control, and a lot of other WV* classes.

    I’ll keep looking at it tomorrow; too tired now. 🙂


    UPDATE – July 24, 2011

    Inside Dock there’s a class called WVSpaces. It has a number of attributes including:

    WVSpace *currentSpace;
    unsigned int currentWorkspace;
    WVSpace *nextSpace;                     // Space on the right???
    WVSpace *previousSpace;                 // Space on the left???
    BOOL currentSpaceIsDashboard;
    BOOL dashboardIsCurrent;
    ...lots more...
    

    Each WVSpace class has an NSString *_uuid; attribute, which is likely its SpaceUUID. So theoretically you can get the current space number like so:

    WVSpace *currentSpace = [[WVSpaces sharedInstance] currentSpace];
    NSString *currentSpaceUUID = [currentSpace _uuid];     // Empty string if main space???
    

    The trick is, how to get access to the private WVSpaces class buried inside of Dock? I’m assuming it’s Singleton as it has an NSMutableArray *_spaces; attribute, probably with every space listed in it. Only one space gets displayed at a time (this holds true if you’re using multiple monitors; the space spans across both of them), so it makes sense to only have one WVSpaces instance.

    So it looks like it’ll require some SIMBL hacking of Dock to gain access to WVSpaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.