Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Where can I learn to create a system-level script

Featured Replies

I need to create and run a scheduled script (or script sequence) that will give me a list of what accounts are logged in, then change a field in a record for each account holder. Any resources anyone could point me to for learning how to do this?

This can probably be done.  But what are you trying to achieve in the end here?  There may be another way to get you the information you need.

 

Steven

Would be helpful to know if you're on Windows or a Mac...

 

You can use PSLoggedOn on Windows  or Who or Users on Unix/Mac via a system level script to return a list of users logged on.  You could then pipe this output to a text file and import this in to a global text field, and parse it in Filemaker to get a value list of logged in users.  

 

However, I'm not sure how you'd do this on demand as system level scripts are run as scheduled scripts on the server which you can't call from FMPro.. but you might want to look here for a way round this if you need this functionality:

http://fmforums.com/forum/topic/85738-call-upon-server-to-run-a-backup-from-pro/

 

As Steven said, what's the end goal here?

  • Author

Thanks for your replies. A little more info.

 

This applies to a database running in FMS 13 on a Windows 2008 server. It is used exclusively by our staff via Web Direct. When a user logs in to the database, a startup script sets a field value to "ON" so other users can see who is currently logged in. An exit script clears the field, but that doesn't happen if the user times out or just closes the browser window. Ideally, I would get people to exit properly, but human nature makes that a losing battle.

 

I want to set up a scheduled script on the server that periodically checks to see who is actually logged in, and then clears that field for those who have timed out. I can script the clearing of the field, but I need a way to to feed it which accounts are actually logged in.

 

Hopefully this clarifies. Thanks again -- Victor

 

You can use PSLoggedOn on Windows  or Who or Users on Unix/Mac via a system level script to return a list of users logged on.  You could then pipe this output to a text file and import this in to a global text field, and parse it in Filemaker to get a value list of logged in users.  

 

 

That's the general idea but instead that of using PSloggedOn or its mac equivalent you need to use the fmsadmin command line.  There is a switch to ask for detailed user info.  Pipe that to a text file in the FMS documents folder and import it into a scratch table in your solution.

  • 4 weeks later...
  • Author

This worked well, with one glitch. It returns user name rather than account, which what I need to match. The user name is not always consistent with the field I can match. I can't find a command that will return the account name.

 

Thanks for your help. -- Victor 

The whole approach should be coupled with writing the OS account name to the FM prefs area and using external authentication.  There are may variables to this.

if you want a fool-proof way that uses the account name specified by the user on login then you need to use the Access.log that FMS keeps (but is not turned on by default).  There is a lot more work in parsing that but it has all the details you need.  I've shown how to do this about 7-8 devcons ago.

Grab a copy of the access.log and learn how to parse it.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.