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.

Add an object to all layouts in the solution

Featured Replies

I'm currently optimizing a solution with approximately 1000 layouts. I know that at most 10% of these are being used, and would like to delete the others.

 

Usually when I do this I put a text block on all layouts saying something like "IS THIS LAYOUT USED? IF SO INFORM ME [DATE]"

Going throught 1000 layouts it's kinda tedious. Is there some kind of third party tool or other solution that can help me with this? Copy Paste is the only option I know of.

 

Tia,

Andreas

36 minutes ago, carlsson said:

some kind of third party tool

Your profile says you're using macOS, so why not AppleScript?

 

Edited by comment

  • Author
25 minutes ago, comment said:

Your profile says you're using macOS, so why not AppleScript?

 

Thanks for the input!

I thought about that, and that's maybe also an option. But it will take me a lot more time to write that script than to ask if there's something simpler. ;)

 

I have written some very simple Apple Scripts, but I have never mastered. Maybe it goes something like this:

Tell application "Filemaker Pro"
Activate
Enter Layout mode
Create object "Info" of class "Text"
Set fill color of "Info" to "Red"
Set text color of "Info" to "Yellow"
Set text of "Info" to "IS THIS LAYOUT USED? IF SO INFORM ME [DATE]"
Go to Layout Next
Repeat in some way
End tell

...but to test this, understand all the errors and correct them, will take me a day. Copy Paste will probably do the job in a couple of hours.

:) 

Not being used <>not referenced. I would use fm perception to truly understand what is referenced. 

For a (hopefully) one-time job like this, you could do simply:

tell application "Filemaker Pro"
	repeat 1000 times
		go to layout after current layout
		paste
	end repeat
end tell

Before calling the script, enter Layout mode manually, go to the first layout, create your text block and copy it. Note that this will error out on the last layout, but again, who cares.

Make sure to have a backup copy before running this.

 

 

Edited by comment

  • Author

Thanks, but when pasting I get an error: "The event failed." number -10000

it works to paste manually.

:(

 

PS. I'm on Catalina and Filemaker 17 Advanced.

Edited by carlsson

I forgot the repeat part (added now), but that's probably not what's causing your error. It works for me in FMPA 18 under macOS High Sierra. 

 

  • Author

Yep, it's something about the "Paste" that doesn't work. Everything else works as it should, and as you said; It's a one time show so it doesn't have to be fancy.

Thanks again, will look into it some more. 

Are you running this from the Script Editor application? You should see a more detailed error message in the Result pane. Also make sure you have copied the text block just before running.

  • Author

1834307087_Skrmavbild2020-01-03kl_19_51_02.thumb.png.c64989eed860c222c6bfb336aa36f919.png

 

This is it. 

Note that "paste" is highlighted.

Can it be that the account need Apple Event privileges? Naah, then go to layout wouldn't work...

However! I just tried it in FM18, and then it works! 🤪

Thank you for the help!

 

I am only guessing here, but do you still get the error in FM 17 if you quit FM 18 (and all other versions of Filemaker that might be open)?

  • Author

I am not at work anymore, but I just tried at another solution and now it works. In both 17 and 18. 

Really strange. Will be back with a result next week.

🤪

Create an account or sign in to comment

Important Information

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

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.