I would like to write a small utility that moves a window from one space to another in OS X Lion. I don't care if the utility is written in AppleScript or Objective-C. What I can't seem to figure out is given a window, how can I move it to a different space. I've seen lots of helpful information in this thread, but nothing about how to actually move the window. If anybody has any thoughts or ideas, I'd appreciate hearing them. Thanks.
Moving a Window to a New Space in Mission Control
2.9k Views Asked by LandonSchropp AtThere are 2 best solutions below
Gavin Brock
On
If you are using objective-c calls, then moving between spaces in 10.7 is actually the same as 10.6 except for one issue. Space ID's were index based in 10.6, but based on something else (not quite a GUID) in 10.7.
If you have a window already in the correct space, the solutions in this question will work (I'm using it in csshX). You can get the space ID with CGSGetWindowWorkspace, and then set it on another window using CGSMoveWorkspaceWindowList.
Now if you don't have the space id - e.g. you just want to move the window to the 2nd space - then I'm as stumped as you are. I'm looking for the linkage between the space id and the index number. (Will update this answer if I find it)
Finally, you mention the App Store in the comment above - this will not be suitable since the CGS* calls use undocumented private frameworks which will get you rejected.
Related Questions in OBJECTIVE-C
- How do I customize NSOutlineView to have border color?
- UIWebView Screen Fitting Issue
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Image and Text locations in UIButton
- setting OpenGL version in objective-C
- Setup code for xibs in iOS. -awakFromNb:
- realm db, get parent link of object
- CFBundleDocumentType is not working in myproject-Info.plist file
- UIPopoverPresentationController not rendering properly
- Using Storyboard Reference
- Pass Data between two view controllers using 'Delegation' : Objective-C
- Unexpected CALayer Vertical Flipping on 3D Rotation 'Bounce'
- Setting View orientation to portrait is ignored
- UITextField append / between dates while enforcing character limit
Related Questions in COCOA
- How do I customize NSOutlineView to have border color?
- How to generate request format for WCF web service method for Mac and iPhone
- How to Handle Command Line Prompt from a Cocoa App
- Change views inside NSSplitViewController
- CMYK NSImage get pixel data
- Reactive Cocoa Conditional Split ?
- Set background color of NSImageView with proportionally sized image
- Use NSWindow or NSViewController?
- Imports and includes in header files - when is it okay?
- How to prevent the app from automatically open a window when launched?
- Swift NSViewController responds to mouseDown event, but not keyDown event
- "stringByAddingPercentEncodingWithAllowedCharacters" replaces more characters than it should
- cocoa - what happen when close a window (by pressing the red X button)?
- Does it necessary to go back to main thread to update UI?
- WebView not responding to Keyboard input
Related Questions in SPACES
- Faster way to remove 'extra' spaces (more than 1) from a large range of cells using VBA for Excel
- StringUtils not working even with included imports
- Regex match quoted string with spaces
- Spaces in a if statement
- Need help in writing this multiplication code
- Write to TXT file with length delimited data
- Encrypting a text file but leaving the space in?
- Tesseract False Space Recognition
- Get-content won't read a file from a path containing an environment variable and spaces
- C# Use Process.Start with parameters AND spaces in path
- Visual Studio 2015: Auto-formatting code adds spaces instead of tabs
- Make sure space bar is always available on numeric pad
- Filepath from editable textbox with spaces
- std::cin skips white spaces
- What to do about spaces on my connection string?
Related Questions in OSX-LION
- Cannot install XCode 4.3.2 on 10.7.5 running on VMWare Fusion 7.1.1
- how to reset Vim & TMUX dotfiles
- "subl" command not working properly
- Can someone please explain to me why I get a different output when I run the same command from Java
- Porting C# mono from windows to mac
- AppleScript: Get list of windows on all desktops
- Accidentally deleted all files by rm - rf /* ... In my macbook pro
- CoreData dynamically create db
- Install Ruby 2.0.0 on an old Mac OS 10.7.5 Lion
- libmicrohttpd ./configure: pthreads not supported (osx)
- install meld on mac lion with macport
- AVFoundation on OSX: OpenGL texture from video WITHOUT needing access to pixel data
- Python installation missing a lot of things on Mountain Lion
- strange chromedriver fail on os x lion
- Initial build error on first project after installing Android Studio .2 on Mac Air
Related Questions in MISSION-CONTROL
- Keeping window on top when switching spaces
- Show NSWindow when Mission Control/Exposé "Show Desktop" is active
- OSX: Monitoring Event when Mission Control is activated
- Osascript/Applescript: Uncheck "Displays have separate Spaces"
- How do I programmatically move Spaces' focus to a particular Space a window I want to focus on lives on Mac OS X with Objective-C?
- Applescript keystroke not behaving as expected
- Add/remove workspace to mac programmatically
- Status bar app popover always on top when mission control is launched OSX
- Unselect Window on Mission Control with Swift
- Move left or right a space programmatically OSX
- How to simulate ctrl+up in Mac OSX?
- Moving a Window to a New Space in Mission Control
- NSWindow at desktop level in Mission Control
- Manipulate OS X windows with script
- Capture all NSWindows as active images like Mission Control in Mac OS X
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You will need to use a custom library, which can be found here http://macscripter.net/viewtopic.php?id=23453, however I'm not sure what kind of support it has in lion.