Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6983 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

On Windows XP, I want to use 'send event' to launch an application on the desktop.

I need to use the 'calculation' option.

If I use the 'file' option to see the path to a desktop application, it is of the form:

file:../../Documents and Settings//Desktop/

Both and can vary which is why I need the calculation option.

How can I get the 'Windows username' so I can properly build the calculation? 'Get(username)' returns the Filemaker username, not the windows username and no other 'Get' function seems to provide the necessary information.

Or is there another form for the calculation to launch a desktop application from 'send event'?

TIA

Posted

If you cannot find windows user name from FileMaker Pro, you can keep track of the user name from within your application itself. If it is an application written in c or vb it is easy to find using api.

Posted

I don't know how to do that. Would it be a plugin or custom FMP function??

Posted

In 8 this is easy since we now have the Get(DesktopPath) function. In 7 you need to jump through a few hoops.

From a Command line window typing "echo %username%" will give you the name of the currently logged-in user. Trouble is: how do you get that into FM? You can only put data into FM through:

- paste

- import

- ODBC

- plugin API

Let's work importing. Have a script that does the following Send Event:

cmd /c echo %username% > c:usernName.txt

(assuming the user has write rights to the c: folder)

Make the script pause for a second or two and import that text file. If you don't want any new records created, import into a global with the "update" option.

Now you have the user name to calculate your path.

Another (cleaner) option is to use a Windows logon script (VBscript) that writes the current user name to the filemaker section of the registry so that the get(userName) function will actually return the name of the OS logon. It needs to be a Windows logon script because FM reads the registry once when it launches, so the info needs to be there before FM starts.

Or go with 8 ...

Posted

Thank you! It's not pretty, but it gets the job done!

This topic is 6983 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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