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

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

Recommended Posts

Posted

Hello, all---

Am trying to write a script (in Scriptmaker or AppleScript) that will set a global text field with the contents of the clipboard. Ideas?

Thanks much

Posted

Actually I don't want to use 'paste' because the global field resides on a different layout. And I don't want to invisibly switch to that layout, do the paste, then come back because that will cause an unwanted refresh to happen on my original layout. That's why I want to do a Set Field. Sorry, I should've been more specific.

Posted

Put the global field on your current layout, disallow entry to it, remove the border, change the font to the same color as the background, and set it to be 1 pixel by 1 pixel, or something similar. Then Paste [ ] into the current layout.

You'll never get the clipboard contents via a Set Field.

Posted

[color:"blue"] Actually I don't want to use 'paste' because the global field resides on a different layout. And I don't want to invisibly switch to that layout, do the paste, then come back because that will cause an unwanted refresh to happen on my original layout.

This is not an accurate statement. You can use the Freeze Window Script Step to help eliminate this problem.

[color:"blue"] That's why I want to do a Set Field. Sorry, I should've been more specific.

The Set Field approach would eliminate the need for the field on the current layout, but in order to set the field with the clipboard, you are still going to need to paste the contents to a field. You might consider a field on your current layout for this purpose. You could hide it by making if 1px x 1px, make it the same color (type and field) as the background, or hide it behind another field. Be sure and remove it from the tab order.

Lee

Wow, why I was away composing this, everyone else answered the question too.

Posted

Lee,

The original version of my script did use the 'Freeze Window' step, but oddly enough the layout still kept refreshing when the script finished executing. Couldn't figure out why.

Anyway, I've gone ahead and used your suggestion of putting the 'invisible' global field onto the layout and pasting into it. Works great--Thanks very much!

Posted

The last step of a script containing a Freeze Window step is always a refresh.

From FM Help re: Freeze Window:

Note No Refresh Window step is needed if it would be the last step in a script. FileMaker Pro automatically turns off Freeze Window and refreshes the display when a script ends.

Posted

-Queue- said:

The last step of a script containing a Freeze Window step is always a refresh.

From FM Help re: Freeze Window:

Note No Refresh Window step is needed if it would be the last step in a script. FileMaker Pro automatically turns off Freeze Window and refreshes the display when a script ends.

Yep. The freeze window will stop the layout you go to from showing (unless it's part of a sub-script, which is stoopid), but it will alway refresh when the script is done, hence the little "flash"

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