ddreese Posted May 13, 2003 Posted May 13, 2003 I'm trying to devise an easier way to do a logout script for my database. Basically all I want the script to do is set the g_user field to blank (easy enough), and close all open files except one. This will allow the user to login as someone else if need be. Aside from writing a script that has close steps for every possible file that may be open (which I'll have to change once there is a new file added into the mix), is there someway I can do this easier? If not... No problem, but it would be nice to know either way. Thanks!
EddyB Posted May 13, 2003 Posted May 13, 2003 Hi, The only way I can think of doing this is a very long way round and could be quite annoying for the user! Set your logout button to close FMPro. In the current database set up a close script which calls a vbscript which reopens FMPro and the current database. Not sure how to do the calling vbscript bit put apparantly it is possible - think you need the File Toolbox Plugin Actually thinking about it - this would be REALLY annoying and could take up to a minute to logout and log back in! Ignore the suggestion! - not good at all! Ed
Vaughan Posted May 13, 2003 Posted May 13, 2003 Why not use the Close [] script step to close the files? I try not to ever quit FMP because the user might be working on other files in the program. Put Close [] steps for each file in the solution. Only try to close one solution at a time. This is a case where user education is the key, and no amount of programming is a replacement (in fact it often gets in the way).
Lee Smith Posted May 13, 2003 Posted May 13, 2003 Hi Vaughan, AMEN! Nothing is more aggravating to me then to be looking at a solution, and have my Application close just because the developer has put in a close FileMaker step instead of close file. My impression is that this developer thinks that His/her files is the only thing that counts and they don't care about what I have open. What an EGO they must have. Lee I feel better now.
ddreese Posted May 14, 2003 Author Posted May 14, 2003 Why not use the Close [] script step to close the files? I try not to ever quit FMP because the user might be working on other files in the program. Put Close [] steps for each file in the solution. Only try to close one solution at a time. This is a case where user education is the key, and no amount of programming is a replacement (in fact it often gets in the way). Yea, that's kinda what I was asking. I mean, other than doing a close [] for every possible file that may be open (depending on which files and layouts they were using). Well, I guess I could just call an external script in each file that would run it for me, therefore I'd only have to change one logout script if I added/deleted files.
paulage77 Posted May 15, 2003 Posted May 15, 2003 You could have your close script point to an applescript that closes the opened files in your solution except one.
Vaughan Posted May 15, 2003 Posted May 15, 2003 "depending on which files and layouts they were using" Layouts are irrelevant to the issue, it's only files. As I said earlier, I colse solutions as a whole. Hopefully you won't be frequently adding or removing files from soutions very often -- if you're still at that stage then you're in development, not production. One function that is handy to work out which files are open is the DatabaseNames function, which returns the names of the currently opened files on the user's computer.
Pupiweb Posted May 15, 2003 Posted May 15, 2003 The way I do it is to use the same login procedure that users would use at startup (see a tip file named The Gateway at http://www.fmfiles.com) When enetering the solution a login script is performed, bringing the user to a layout in which they have to enter username and password; in this layout you've 2 buttons, Enter and Cancel; the Cancel button would close all files. So just create a Re-Login script that calls the same login routine; if a new user logs in s/he'll find already opened files, otherwise all files will close
Recommended Posts
This topic is 7867 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now