January 3, 20206 yr 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
January 3, 20206 yr 36 minutes ago, carlsson said: some kind of third party tool Your profile says you're using macOS, so why not AppleScript? Edited January 3, 20206 yr by comment
January 3, 20206 yr 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.
January 3, 20206 yr Not being used <>not referenced. I would use fm perception to truly understand what is referenced.
January 3, 20206 yr 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 January 3, 20206 yr by comment
January 3, 20206 yr 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 January 3, 20206 yr by carlsson
January 3, 20206 yr 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.
January 3, 20206 yr 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.
January 3, 20206 yr 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.
January 3, 20206 yr Author 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!
January 3, 20206 yr 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)?
January 3, 20206 yr 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