2 Replies Latest reply on Feb 17, 2011 6:31 PM by DanielClark

    Set variable on User log in

    DanielClark

      Title

      Set variable on User log in

      Post

      I have my database sitting on a server with other Filemaker users accessing it via the Filemaker network. Every user has a user name and password to access the FM Network. I use buttons on certain layouts that allow access to data on a server. THere are two different root drives on the server - one meant for certain users, the other drive meant for others. I want the database to know who logs in, so say if John Smith logs in - I can tell the script on the button to mount Drive 1 to access the data - while if Jane Doe logs in, Drive 2 will be mounted via that script. I know what I have to do with the script - I want to use a variable that is set via that user to set the path of the drive to mount. How do I do this? Thanks.

        • 1. Re: Set variable on User log in
          philmodjunk

          I'm curious to see how your script will "mount a drive" from filemaker. Opening a specified file hosted on the server, that's simple, but "mount a dirve"?!!!

          You can use File Options to specify that a script run when the file opens.

          This script can use Get ( AccountName ) to identify the user. You can use Get ( AccountPrivilegeSetName ) to identify all users with the same privilege set, which can be simpler if an entire group of users is to be handled exactly the same way.

          If you have a table of the info you need for your two groups of users, the info from those Get functions can be used to look up the needed data and the data can be copied to global variables with the set variable script step.

          • 2. Re: Set variable on User log in
            DanielClark

            Ahh, the beauty of AppleScript...

            Because Filemaker can initiate Mac OS X's applescript functionality and execute AppleScript code - I can use Filemaker to do anything that I can do on my mac - including mounting certain drives, dimming my screen, turning up my volume, you name it - pretty sweet. But thanks for the advice. For now - I think I'm just gonna have a toggle switch in the form of a checkbox set to allow the user to choose which drive to mount - so cool. Thanks anyway!