Run application on specific location

Discussion in 'macOS' started by subzero, Nov 14, 2005.

  1. subzero macrumors newbie

    Joined:
    Nov 2, 2005
    Location:
    Denmark
    #1
    Hello MacRumours-users,

    I have recently switched to a PowerBook with Mac OSX Tiger. I am using this portable both at home and as well at school and work.

    All of these locations have different smbd-shares. I would very much like to be able to run an application on location-switch, that would mount the appropriate shares on my portable.

    The application I would like to execute is AutomountMaker, which can be set to run on user-logon.

    Is it possible to run this application on location-switch?
    - I imagine that I would need some AppleScript to retrieve the current location and load the associated AutomountMaker-script.
     
  2. varmit macrumors 68000

    varmit

    Joined:
    Aug 5, 2003
    #2
    The only way to automate this process is to mount the Share and save the username and password to the Keychain, open System Preferences, Accounts, click on the Login Item, drag and drop the mounted share to this area. Then on boot up it should mount the drive automatically. Do it for all shares at all he different locations, and it should hopefully mount the drives on boot up for that particular location. Note, you will need to boot from scratch to get this way to work. Not just sleep the computer and open it up at the new location and have the drives auto mounted for you. Otherwise, its a manual run the script when you get to said location. Also, you might lock up the Finder with the way I told you, because I have never done it at multiple locations and mounting multiple drives, but hopefully it just skips the ones it can't find.
     
  3. subzero thread starter macrumors newbie

    Joined:
    Nov 2, 2005
    Location:
    Denmark
    #3
    I have already created multiple AppleScripts to mount the different shares.

    I guess there is no way to execute these scripts on login (e.g. from sleep - my PB is never turned off).

    I might just script a bash-script and run it like every 5th. minute from crontab and check if the mounted volumes are correct according to the current location.
    With that solution I would still need to be able to find the selected network location from within a terminal - would you perhaps know how to do that?
     

Share This Page