Jump to content

Switch Windows Application to Filemaker


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

Recommended Posts

I am using remotescripter to run a script in filemaker. Which works no problem there.

What i want to do is bring Filemaker to the foreground also,

So for instance say if im looking at emails, and the script is remotely triggered then I want windows to switch to Filemaker and not just run the script in the background and wait for me to click on filemaker.

Filemaker will always be open.

Any ideas

Thanks

Link to comment
Share on other sites

I have not tested this so I do not know if it will work but you may be able to use the "Send Event" script step. Set it to do a script that just shows a custom dialog or whatever you want and then check the box that says "bring target application to the front" and select FileMaker as the target app. 

Link to comment
Share on other sites

  • 3 weeks later...

You can use vbscript to do this:

set s = CreateObject("WScript.Shell")

s.AppActivate "FileMaker Pro Advanced"
wscript.sleep(100)
s.SendKeys("% r")

"% r" restores a window, "% x" maximizes, "% n" minimizes.

This only works for already open applications, it won't start the application if it's not running. It also may not work on non-English Windows as the Min/Max/Restore commands are localized and will have different shortcuts.

Link to comment
Share on other sites

I think a word of caution is in warranted here. I've never been a fan of applications that steal focus. More often than not, I'll be working on something and if an app steals focus, whatever I'm typing isn't going where I intended it to go.

This could easily happen in your case too. In fact, your script stealing focus to FileMaker, could have all sorts of unintended results. You might be typing away in your email client, not looking closely at your monitor (or you might have dual screens and FM is on the other screen), and you're typing and hitting enter for new lines. However, because FM just took away focus, you could be entering data in records and committing it without realising it. Or you might be pressing key combinations in your mail client that have different meanings in your FM app. You'd have to protect your FM app from that.

If you want to go down the VBscript way you can use FM's ActiveX interface to test if it is open and open it if it is not.

http://www.filemaker.com/help/13/fmp/en/html/create_script.13.10.html

 

Thanks Wim, didn't know that. Might come in handy.

Link to comment
Share on other sites

This topic is 3068 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.