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 to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
Related Questions in COCOA
- In what context can we use an unqualified #selector() expression in Swift?
- How can I trigger macOS system gamepad API based on a value received from iOS app through core bluetooth
- Using sort descriptors in Outline View
- NSTableView to NSOutlineView Drag & Drop not accepting drop
- How to remove horizontal line in bottom of section NSTableView?
- CGSRegionRef: How is an arbitrary region represented as union of rects?
- Listen for Touch Events on MacOS (Trackpad)
- Window "yanks" when moving
- Writing NSFilePromiseProviders to pasteboard blocks app on quit
- Basic ImGui program doesn't render, leaks memory and crashes
- NSTokenField suggestion using context menu in swift
- How to link multiple text views to a single text storage in TextKit 2
- I would like to know why I’m not getting IBOutlets connected in an App’s window
- How to make a custom event loop in Cocoa?
- Why is restoreWindow(withIdentifier:state:) called after applicationDidFinishLaunching(_:)?
Related Questions in SPACES
- How to identify records in a DataFrame (Python/Pandas) that contains leading or trailing spaces
- Why do I get extra spaces in an integer list while doing list operations in python3?
- How can I use GitHub CLI to include search queries with spaces?
- Regular expression in R for finding spaces ONLY after a known word
- How do I format the Target field of a Windows SendTo shortcut to quote the paths I'm passing to it?
- How to copy with files with spaces with cp command
- Python: space before and after operators like =, +, -, etc
- NGINX Thumbnail Generation won't work with spaces or %20 in Ubuntu 22 but did in Ubuntu 16 - Nginx 1.23.0 specific
- Is there an alternative for --data-urlencode only for spaces?
- How to find if folder name contains spaces in Bash
- Python PyPDF - getting additional spaces when reading text using ExtractText
- Space that vba does not "see" in word document??? What is that?
- PHPSpreadsheet: Putting/Showing multiple spaces (whitespace/indentation) in a cell
- How do I get R to work with spaces in a file path?
- How to restrict the user to enter leading, trailing and consecutive space in a string in kotlin
Related Questions in OSX-LION
- How to pass arguments to mac terminal in llldb mode
- how to fix NSCollectionViewItem overlap problem?
- Ascii Error when building Nikola on 10.7.5
- How to install a system framework required for MacOS application
- Bazel for Mac os Lion
- export DYLD_LIBRARY_PATH causes libncurses.5.4.dylib not loaded error
- OSX Catalina / OSX Tiger - mouting any ISO problem
- macos on Synology VM manager
- How to RDP Ubuntu 16.04 and OSX from a Windows 10 Home Pc on lan
- How to configure to run jenkins with java 10 on mac?
- How to run Eclipse Oxygen on Mac OS X 10.7.5
- Installing Homebrew with Git 1.8.4.2 (Mac OS X 10.7.5)
- install4j gives error _CTFontCopyDefaultCascadeListForLanguages
- Linux search for file name with multiple paramter
- IOS App developed using Xcode 4.6 can be comptaible with recent Iphone versions
Related Questions in MISSION-CONTROL
- Applescript click on window title bar
- How Programatically Change Spaces Sequence?
- Unselect Window on Mission Control with Swift
- How to simulate ctrl+up in Mac OSX?
- Move left or right a space programmatically OSX
- Osascript/Applescript: Uncheck "Displays have separate Spaces"
- How to get the current workspace programmatically on macOS
- Mac/Cocoa: how to determine if a window's screen has menubar and Dock?
- Manipulate OS X windows with script
- Add/remove workspace to mac programmatically
- Manipulating "spaces" to swipe faster
- Status bar app popover always on top when mission control is launched OSX
- Capture all NSWindows as active images like Mission Control in Mac OS X
- OSX: Monitoring Event when Mission Control is activated
- Show NSWindow when Mission Control/Exposé "Show Desktop" is active
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 # Hahtags
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.