Assigning applications to spaces

Hello, I need an Automator application that can assign certain applications to a specific Space.
Here is what I have so far:
Ask for Finder Items
Set Value of Variable
Get Value of Variable
And an Applescript as the following:
on run {input, parameters}
tell application "System Events"
tell expose preferences
tell spaces preferences
set application bindings to {|Address Book|:2}
end tell
end tell
end tell
end run
The problem is, I am not sure how to pass the variable to AppleScript. Any pointers will be appreciated!!
Regards,
Adam

That´s, what i meant with "overwrite"
So this Applescript (based on the "Assign to Spaces" Script from the posted link) will do this job -- but only, if there exists already an application assignment in Spaces!
Again:
• Ask for Finder Items
• Run Applescript
on run {input, parameters}
set displayString to "Assign choosen applications to Space:"
set defaultAnswer to 0
repeat
set response to display dialog displayString default answer defaultAnswer
try
set theNumber to (text returned of response) as number
exit repeat
on error errstr
set displayString to errstr & return & "Please try again."
set defaultAnswer to text returned of response
end try
end repeat
repeat with x in input
set app_identifier to bundle id of (info for x)
set app_identifier to do shell script "echo " & quoted form of app_identifier & " | /usr/bin/perl -pe 'use encoding utf8; s/(\\w)/\\L$1/gi'"
set app_construct to (run script "{|" & app_identifier & "|: " & theNumber & "}")
tell application "System Events"
tell spaces preferences of expose preferences
set app_layout to application bindings
end tell
end tell
set app_identifier to bundle id of (info for x)
try
app_layout as number -- causes an error anyway
on error errstr
set app_locations to {}
set {TID, text item delimiters} to {text item delimiters, "{"}
set errstr to text item 2 of errstr
set text item delimiters to "}"
set errstr to text item 1 of errstr
set text item delimiters to ", "
set errstr to text items of errstr
set text item delimiters to TID
repeat with i in errstr
set o to offset of "|:" in i
tell i
set app_location to {}
set end of app_location to text 2 thru (o - 1)
set end of app_location to text (o + 2) thru -1
set end of app_locations to app_location
end tell
end repeat
end try
set spaces_bindings to {}
repeat with i from 1 to count app_locations
if app_identifier = item 1 of (item i of app_locations) then
--skip it
else
set spaces_bindings to spaces_bindings & (run script "{|" & item 1 of (item i of app_locations) & "|: " & item 2 of (item i of app_locations) & "}")
end if
end repeat
tell application "System Events"
tell expose preferences
tell spaces preferences
set application bindings to spaces_bindings
set spaces_bindings to app_construct & spaces_bindings
set application bindings to spaces_bindings
end tell
end tell
end tell
end repeat
return input
end run
Spazek

Similar Messages

  • Query on using Spaces feature to assign applications to spaces

    I like the new Spaces feature, having been a user of VirtueDesktops before.
    I have an issue with assigning an application to a particular Space.
    The instructions from Help are below. I was able to do this for 4 applications, which seems to be as many as fit into the window available for listing them. Then, I hit the "+" to add other applications that are already running. When the pop-up menu appears, it does not list those applications (it does list Finder and the System Preferences that is running). So I go ahead and pick the application off the list from my Applications/ directory. It doesn't then appear in the list of applications in Spaces so that I can assign it to a particular space.
    I assume that there isn't a limit to the number of applications I can assign in this way. Or is there a limit of 4.
    In addition, when I use the Help feature on the Spaces assignment preferences panel, this text appears:
    "To choose a space for the application, click the current space and choose from the pop-up menu."
    However, it is not clear what "click the current space" means. One of the little numbered box images for the spaces that I have? Nothing happens when I click them.
    Thanks for help.
    (Optional) To assign an application to a particular space, click the Add button and choose the application.

    If you want the application to always open in a particular space, click the pop-up menu and choose the number for the space you want.

    If you want an application to always be available, no matter which space you’re in, open the pop-up menu and choose Every Space.

    You cannot add the same application you already assigned to a Space.
    When you click the + sign, the pop-up menu shows the running applications which have not been assigned to a Space. If an application has been assigned to a Space, it will not be shown in that menu because the System Preferences/Expose/Spaces preference pane is used only for assigning applications to Spaces. If it is already assigned, there is no need to show it because it cannot be assigned to another Space. In that menu if you select “other” it will open your Applications folder, but any apps that have been assigned (and others that are not applications) will be grayed out. Perhaps what you are trying to do is assign the same application to two different Spaces. This cannot be done with the virtual desktop in Leopard, Spaces.
    You said you had experience with other virtual desktops. Those often let the user assign an application to two or three or more desktops. Spaces does not allow that. An application can be assigned to one Space or all Spaces, but not anything in between.
    I have interacted with other users who have experience using other virtual desktops and see this as flaw in Spaces. Perhaps it is. I have not worked with other virtual desktops. But this is how Spaces operates as a virtual desktop: an application can be assigned to one Space or all Spaces, but not 2, 3, 4 or any other number.
    If you see this as a big drawback with Spaces, you should notify Apple. I don’t remember the website for reporting bugs and suggestions, but you should be able to find it on these forums.
    If you are trying to navigate to the application running in Space 5, hold down the Control key and press the number 5 key. If you want to move the application in Space 5 to an adjacent Space, grab a window of the application in Space 5 and drag it to the any of the four edges of that window and it will switch to that Space. However, if you quit that application and open it again, it will open in its assigned Space, Space 5.

  • Why can't I assign applications to spaces anymore?

    I used to have my different apps (Mail, iTunes, Safari) open in separate spaces and the SAME space every time.  I did this by right clicking on the open app icon in the dock and selecting options > Assign to > This desktop.  This no longer works.  Now applications ALWAYS open in the first space.  When I right click on the icon now there is NO OPTION to assign where the app opens.  The ONLY application I still have this option for is safari.  For all  the others it has disappeared.  For example now when I right click on the mail icon the only options I have are: Keep in Dock, Open at Login, Show in Finder.  There used to be the option to assign Mail to the current desktop, all desktops or none.  That option has now disappeared.  The same goes for iTunes and other apps.
    Please note that I was well aware of how to assign apps to desktops before.  Since 10.8.4 that option has now disappeared from my interface.  Mission control offers no way to assign apps to spaces either.  What happened?

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, or by a peripheral device.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain iMacs.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Assign applications to spaces is Lion

    How do you assign specific applications to spaces in OS X Lion?

    Which application? 
    You don't see something like this?

  • Assigning applications to spaces under Mavericks

    In mountain lion you could assign an application to a particular space or all spaces. This option no longer seems to be available in Mavericks. The problem is that mavericks remembers the old settings. Is there a way to change the old settings?

    Hi cklunar,
    I am running Mavericks 10.9.1 on a iMac 2013. The second display is a iMac 2010 in target display mode.
    I have Automatically rearrange Spaces unchecked
    Ok, I have to say that while I was preparing the answer I played with the two monitors even more and this is now what I understand:
    - suppose I have 3 desktops on each monitor: Display 1 (Desktop 1-3), Display 2 (Desktop 4-6).
    - I am working on Display 1/Desktop 1, and the app is also on Display 1/Desktop 1 and I right click on the dock icon then I won't see the option of assigning to a desktop, only to a display (see screenshot). For instance I am typing in Chrome, which is in Display 1/Desktop 1. The same would be true if I was in Display 2/Desktop 4 while Display 1 is on Desktop 1. This is why I was getting it wrong.
    - I am working on Display 1/Desktop 2, and the app is still on Display 1/Desktop 1 and I right click I will now see the option of assigning to a desktop (see screenshot).  The same would be true if I was in Display 2/Desktop 4 while Display 1 is on Desktop 2.
    - Some things are odd. For instance, I have iTunes on Display 2/desktop 6 but I would only have the choice of assigning it to Display 2/ Desktop 5 (see screenshot)
    I hope it makes sense, and I hope it is useful to others. I am relatively new to OS X.
    Mario

  • How to Change Application-to-Spaces Assignment in Lion?

    Hi,
    Before upgrading to Lion, I had made some application-to-spaces assignments, which I'd like to change/remove. I don't seem to be able to find that option in Lion's Pref Panes (nor in the Mission Control app), and yes, a few of my applications continue to stubbornly launch into the previously assigned space and yes, they have not been updated for the Lion changes (the continue with the "Save As..." model and no leonine versions control). I suspect that there is somewhere a hidden configuration statement, and I'm not shy of editing the pref/config file with Text Wrangler or such, but don't know what to look for. I will also follow up with the individual application developer, but hope that there is a OS X system solution.
    Thanks.Tristan

    What you are looking for is Mission Control (what spaces/expose became). In System Preferences you'll see the tab for it. Open it and you can configure/re-configure as you want.
    To assign/unassign an application to a desktop (what spaces became) click the icon for the app in the dock keep the mouse button pressed. You'll see something like
    Under options is the Assign menu. That's were set the desktop (or no desktop) for the app.

  • 10.5.3 assigning apps to Spaces issue

    Also started this thread over at MacRumors, but wanted to check here as well:
    Can anyone else test this. Since 10.5.3, I'm having 2 issues with Spaces.
    *1) Whenever I open up the Spaces preferences, I see the following in the Console:*
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/LiveType.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Adobe%20Photoshop%20CS3/Adobe%20Photoshop%20CS3.ap p/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Final%20Cut%20Express.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Safari.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/iMovie%20(previous%20version).localized/iMovie%20HD.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Yummy%20FTP.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Microsoft%20Office%202008/Microsoft%20Entourage.ap p/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/BBEdit.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Adobe%20Flash%20CS3/Adobe%20Flash%20CS3.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Microsoft%20Office%202008/Microsoft%20Word.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Microsoft%20Office%202008/Office/Microsoft%20Offic e%20Reminders.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Adium.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/System/Library/CoreServices/Finder.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/iTunes.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Adobe%20Dreamweaver%20CS3/Dreamweaver.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Firefox.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/Mail.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/iChat.app/
    Jun 1 15:48:11 System Preferences[13262]: err = 0, url = file://localhost/Applications/iMovie.app/
    Jun 1 15:48:44 System Preferences[13262]: err = 0, url = file://localhost/Applications/Safari.app/
    *2. When in the Spaces preferences, you used to be able to click on an application in the list and DRAG it to the space you want to assign it to.* For example:
    a. Open Spaces preferences
    b. Click on the + (plus) button to add an application to the Application Assignments list, let's say Address Book
    c. Once the Application is in the list, click and drag it to the space to assign it to, say, Space 3.
    d. The application SHOULD now be assigned to that space.
    Since 10.5.3, I'm not able to drag any application to the space to assign it. It doesn't change the space assignment. I can still select the space in the dropdown.
    Can anyone else confirm either of these (either the Warnings in the console or the behavior I'm seeing)? Neither my Mac Pro or MacBook work correctly.
    -Kevin

    I cannot replicate your problems, so I would assume either you upgraded over an already dysfucntional system or your update was corrupted in some way.
    To start I would suggest you download the 10.5.3 Combo Updater and reinstall it after you do the following:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now shutdown the computer for a couple of minutes and then restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger, and 4.1 for Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    If this does not resolve the problem, then you will need to reinstall OS X. Assuming the disk is OK you can do that as follows (you will need about 10 GBs of free space or more:)
    How to Perform an Archive and Install
    1. Be sure to use Disk Utility first to repair the disk before performing the Archive and Install.
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger) and/or TechTool Pro (4.5.2 for Tiger) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Do not proceed with an Archive and Install if DU reports errors it cannot fix. In that case use Disk Warrior and/or TechTool Pro to repair the hard drive. If neither can repair the drive, then you will have to erase the drive and reinstall from scratch.
    3. Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When you reach the screen to select a destination drive click once on the destination drive then click on the Option button. Select the Archive and Install option. You have an option to preserve users and network preferences. Only select this option if you are sure you have no corrupted files in your user accounts. Otherwise leave this option unchecked. Click on the OK button and continue with the OS X Installation.
    4. Upon completion of the Archive and Install you will have a Previous System Folder in the root directory. You should retain the PSF until you are sure you do not need to manually transfer any items from the PSF to your newly installed system.
    5. After moving any items you want to keep from the PSF you should delete it. You can back it up if you prefer, but you must delete it from the hard drive.
    6. You can now download a Combo Updater directly from Apple's download site to update your new system to the desired version as well as install any security or other updates. You can also do this using Software Update.

  • Assign apps to Spaces (as previously with spaces)

    Hello there,
    With Spaces I was able to assign application to specific spaces, now with Lion I can't seem to save the state, where applications should open.
    For example I like to have iTunes on Desktop 2, so that I have a clean desktop for work on Desktop 1, as soon as I restar tthe computer iTunes and everything that was previously opens on different Desktops (spaces), opens on desktop 1 and I have to sort everything again. I miss that feature to assign applications to specific spaces. Does anyone know a way to do this in Lion, or a tool to download?
    Thanks very much for your input,
    Joe

    I did not do a clean install; ML was installed over Snow Leopard.
    I have found that the only way application assignments to specific Spaces will "stick" is if you check the box that says "Reopen windows when logging back in" at Restart.  Even then, getting assignments made can be a process of fiddling, with restarts necessary at times before you can assign them.  It is much harder than in Snow Leopard, and of more limited use (since you have to allow your system to reopen applications upon restart and not quit applications before shutting down).
    I participated in another thread on this subject, where I gave a few more details.

  • Assign applications to desktop

    How can I assign applications to open on specific desktops? i used spaces but seems it's gone
    I still have the applications i used to have assigned to different spaces now assigned to desktops
    but how can i cinfigure it now? how come when i change the desktop backgriund i have to to it in every different desktop?
    Thanks

    Go to the Desktop you want to use. Right-click the application's icon in the Dock. Select Options > Assign To > This Desktop.
    Desktops can have different backgrounds, if you want. A new Desktop get the same background as Desktop 1, until you change it. But changing a background only applies to the current Desktop.

  • Assigning a literal space to a report cell

    Hi
    I want a report column cell to be assigned a specific background colour depending on the value of another column. I can get conditional formatting to work fine by conditionally setting background and foreground colour in the SELECT statement, but what I really want is to use a dummy column as a means to conditionally display a 'bar' of colour as a red / amber / green indicator for the row.
    I believe that I have to assign a literal space ( ) to the column to do this, but don't know how to do this in SQL via an UPDATE. Any help or ideas appreciated.
    Jules

    UPDATE your_table
        SET your_column = ' ';If your column in your table is a VARCHAR column a value of space will be converted to NULL in an update statement. NULL will be stored in the database. This will not help you.
    Could you set your_column in the database table to any value and set the foreground column color to match the background color in the report region? Then you should not see the value on the screen, right?
    Mike

  • Assign Application Roles

    Hi All,
    I am new to SOA and I want to know how to assign application roles (Not global roles) through EM Console. As, I am unable to assign the roles through  BPM workspace. I can go to the administrator tab and assign the roles to me. But in the task list I am unable to get the task.
    Thanks and Regards,
    Ram

    Hi Ram,
    Refer this doc:
    http://docs.oracle.com/cd/E24628_01/doc.121/e36415/sec_features.htm#CJADDBGA
    HTH
    Mani

  • 'The argument ' 0.000 V' cannot be interpreted as a number' when assigning application structure, line 805, contents "20140611NB F000000004500098898102E202USD 000..."

    Hi All,
    Data loading of 2LIS_02_SCL and 2LIS_02_ITM is getting failed by throwing an error
    'The argument ' 0.000 V' cannot be interpreted as a number' when assigning
    application structure, line 805, contents "20140611NB
    F000000004500098898102E202USD 000..."
    Here Data is not even loading to PSA so I cannot edit the data in PSA.The process chain is getting failed at Load step it self.
    I have even checked the ECC for the particular PO mentioned In the error message but i could not found any issue in ECC

    Hi There,
    Does anyone know the root cause of it? We are facing the same issue.
    Please keep in mind, IT`s NOT PC FILE DATASOURCE. It`s standard 2LIS_02_ITM extractor.
    Thanks in advance.

  • E-Rec : How to assign applications to requisitions?

    Hello Experts,
    We have just started blue-printing of E-Rec and I am successful creating a requisition from Recruiter's page. I am just concerned how to assign applications to a requisition as search doesnt work being a very new system. I was trying to create an application using link "Create External Applications" from Recruiter's login page. Please guide.
    Additional details: We have ECC and E-Rec on different box with EhP5.
    Thanks and regards,
    SAP E-Rec Guy

    You can always search for postings using a reference code - TREX and the indexes do not need to be setup for that to work.  The create internal / external applications link is really used for a recruiter to create an application on behalf of a candidate.  You could always just register a new external candidate and search for the job posting using the reference code and apply that way.

  • Where is the association between applications and Spaces screen configured in Mountain Lion?

    Where is the assocation between Applications and Spaces screen configured in Mountain Lion?
    In 10.6, I had FileMaker come up in Space 2, and it still does in 10.8 but I don't know how to change it.
    Anyone know?

    Right-click the icon in Dock and select Options

  • Talent Management - Assign Application Forms to PDF Docs IMG Step

    Hello,
    We are having some issues with the configuration step u201CAssign Application Forms to Elements of PDF-Based Documentsu201D.
    Here are the steps we have taken so far:
    1)     Copied the Application Forms from Client 000 (HRTMC_RM_COVER, HRTMC_RM_TALENT_AGENDA_TOPIC, HRTMC_TALENT_PROFILE, HRTMC_TALENT_SHORT_PROFILE) to our Sandbox & Development Clients
    2)     Set u2018Use Complex Bundlingu2019 to u201Ctrueu201D via FPCONNECT (SM31)
    3)     Attempted to add the different u201CParameter valuesu201D HRTMC values (specified above) to the IMG config step assign application forms to elements of pdf-based docs
    When trying to complete #3, we receive an error u2018enter a valid valueu2019.  I checked both the Application Forms and the Forms Class and these objects exist, and are active.  We even re-transported the objects to see if that was the problem, but it did not work.
    Any thoughts to why we are receiving this message?

    <b>ASAP Roadmap (SAP Help)</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/48/623972d55a11d2bbf700105a5e5b3c/content.htm
    <b>ASAP Methodology &  ASAP Roadmap (SAP Service Marketplace) - Requires OSS Login</b>
    http://service.sap.com/asap & http://service.sap.com/roadmaps
    <b>Overview of the ASAP methodology - Richard W. Vawter, University of Southern California</b>
    http://www-rcf.usc.edu/~anthonyb/itp320/ASAP.ppt 
    <b>Implementing SAP R/3 in 21st Century: Methodology and Case Studies
    Dr. Arzu Balo&#287;lu. Marmara University.</b>
    http://www.tojet.net/e-book/SAPBook.pdf 
    <b>Implementing SAP R/3 - Book Review Presentations - UNIVERSITY OF KENTUCKY</b>
    http://www.uky.edu/IT/AdminApps/IRISTechPortal/Presentations/Presentations.htm
    <b>SAP Project implementation:  Example Project Blueprint & Project Charter
    University of Tennessee</b>
    http://iris.tennessee.edu/sap_project.htm

Maybe you are looking for