Mission Control and Dreamweaver

Discussion in 'macOS' started by eladnova, Dec 24, 2012.

  1. eladnova macrumors regular

    Joined:
    Aug 31, 2012
    #1
    Hi folks

    I'm new to Mission Control and was wondering if there was a way to have 2 Desktops with a different 'state' of an application in each.

    Ideally I'd like 'Desktop 1' running Adobe Dreamweaver with a 'Client 1' site open while 'Desktop 2' would have another 'Client 2' site open.

    Just to clarify, by 'site' I mean the Site View in Dreamweaver with FTP, CSS and File browser.

    Thanks
     
  2. switon, Dec 24, 2012
    Last edited: Dec 24, 2012

    switon macrumors 6502a

    Joined:
    Sep 10, 2012
    #2
    RE: running two instantiations of an app...

    Hi eladnova,

    First of all, I don't use Dreamweaver and so can't answer specifically, but I'm pretty sure you will be able to do what you wish by one of the following strategies:

    (1) If Dreamweaver opens two windows, one on Site 1 and one on Site 2, then you can just move the Site 2 window to the second Desktop using Mission Control. Desktop 1 has Dreamweaver's Site 1 window and Desktop 2 has the Site 2 window. Problem solved.

    (2) If Dreamweaver does not open two windows, then you can run two instantiations of Dreamweaver, one for Site 1 and the other for Site 2. To run two instantiations of the same app may require a little work, depending upon how Dreamweaver works. You can either:

    (2a) Some apps allow a second instantiation to be run just by executing the executable a second time. In this case, you would start Dreamweaver by the usual method, say clicking on its Dock icon. Then you would open a Terminal window on your second Desktop, find the Dreamweaver executable (probably something like /Applications/Dreamweaver.app/Contents/MacOS/dreamweaver), and run the second instance of the app via the Terminal command "./Applications/Dreamweaver.app/Contents/MacOS/dreamweaver". If this works, it will run a second instance of dreamweaver which you then use to open Site 2 on Desktop 2. If this does not work, and some apps do not allow this through a locking mechanism, then try (2b).

    If you need to run the second Dreamweaver often, then I would suggest adding the path to the dreamweaver executable to your PATH environment variable. You could do this with the following code (assuming that the dreamweaver executable is in the directory listed above), preferably added to your ~/.bashrc script:

    Code:
    PATH=$PATH:/Applications/Dreamweaver.app/Contents/MacOS
    export PATH
    
    Once your PATH has been setup properly, you may then execute the second instance by just typing "dreamweaver" in the Terminal app's window. [Once again, this is assuming "dreamweaver" is the name of the actual executable --- since I don't use Dreamweaver, I can't check that this is correct, you will have to figure this out yourself.]

    Personally, in my ~/.bashrc login script I use the following two tools for appending or prepending to my PATH variables:

    Code:
    #!/bin/bash
    # Append to a path variable:
    append_path()
    {
      if ! eval test -z "\"\${$1##*:$2:*}\"" -o -z "\"\${$1%%*:$2}\"" -o -z "\"\${$1##$2:*}\"" -o -z "\"\${$1##$2}\"" ; then
        eval "$1=\$$1:$2"
      fi
    }
    
    # Prepend to a path variable:
    prepend_path()
    {
      if ! eval test -z "\"\${$1##*:$2:*}\"" -o -z "\"\${$1%%*:$2}\"" -o -z "\"\${$1##$2:*}\"" -o -z "\"\${$1##$2}\"" ; then
        eval "$1=$2:\$$1"
      fi
    }
    
    prepend_path PATH $HOME/bin
    prepend_path PATH $HOME/local/bin
    append_path PATH /Applications/Aquamacs.app/Contents/MacOS
    append_path PATH /Applications/Aquamacs.app/Contents/MacOS/bin
    append_path PATH /Applications/Server.app/Contents/ServerRoot/System/Library/CoreServices/AdaptiveFirewall.bundle/Contents/MacOS
    prepend_path LD_LIBRARY_PATH $HOME/local/lib
    
    export PATH; export LD_LIBRARY_PATH
    unset append_path; unset prepend_path
    
    (2b) If the Dreamweaver program does not allow a second instantiation to run via (2a), then you might still be able to do so by using a different user account. Let's say your user short name is "myaccount" and you have (or can create) another user account by the short name of "otheraccount". Then start the Dreamweaver.app on Desktop 1 by the normal way, clicking on the Dreamweaver Dock icon, for instance. This starts Dreamweaver on Desktop 1 for which you load Site 1. Now switch to Desktop 2 and open a Termnal window. In this terminal window switch users to "otheraccount" using the "su" command ("su otheraccount"), and then start a second instantiation of Dreamweaver by the method outlined in (2a). The problem with this method is if Dreamweaver needs to write your your local directory, then the permissions for the user "otheraccount" and your directories must be configured to allow "otheraccount" to have read and write privileges to "myaccount"'s directories. While this is entirely possible, it can get messy on the permissions side of things. [By the way, I personally use this (2b) method occasionally to run two instantiations of an app, so this does work in cases where (1) and (2a) do not work.]

    (3) Lastly, let's say (2a) does not work and you don't want to try (2b), then you might also think about figuring out how the app's mechanism for locking itself so it only allows one instance to be running. Many times the app uses a locking file in the /var/run directory (sometimes in /var/tmp) that typically contains the app's process id number. You might then consider ... ... ... okay, on second thought, this method is too dangerous and I suggest returning to (2b).

    Sorry I couldn't give specific Dreamweaver instructions. Many apps allow two windows to be opened on different files (sites in Dreamweaver's case, if allowed), transferring one window to a second desktop solves your problem. But if Dreamweaver does not allow two windows on different sites, then you may be able to run two instances of Dreamweaver, one for each site.

    Good luck,
    Switon
     
  3. eladnova thread starter macrumors regular

    Joined:
    Aug 31, 2012
    #3
    Hi switon

    Thanks for taking time to write this. I'm going to give it a shot over the coming weeks and appreciate the detailed help.

    Cheers
     

Share This Page