Tony O Posted April 13, 2005 Posted April 13, 2005 I was just writing a script that I intended to use to drop the user into a new window and step the window into Layout mode, from Browse, and can't find any way to do that. Strange that there are script steps to enter all of the other modes (and views) except this one. Thinking that I could just do this as an applescript step, I opened FM's dictionary and darned if there isn't a way to do it there either. Yes, it's easy enough to get there by command key, I just wanted to make the user explicitly aware that they were in layout (it's to fine tune a print layout). Anyone have an answer for this? Much appreciated! Tony
BobWeaver Posted April 14, 2005 Posted April 14, 2005 Can't be done. Generally, you don't ever want to let the user into layout mode unless the user is also the developer. What sort of things do you want the user to fine tune for the report?
DykstrL Posted April 14, 2005 Posted April 14, 2005 Unless your user has some very good developing skills in FileMaker -AND- is very well versed and trained in your application, like BobWeaver said, it is a very BAD idea to give users access to change layouts. They will add wrong fields, delete wrong fields, change your print design. That is probably why FileMaker did not add that as a script step. There are some other ways that you can fine-tune your report layout to get it to print correctly on virtually any printer and in any situation.
Fenton Posted April 14, 2005 Posted April 14, 2005 While it is generally true that you don't want users to mess with your layouts, there are all kinds of situations. FileMaker 7 gives us some ability to allow or deny layout access to any particular layout, in Accounts & Privileges. I have several clients who come to me with their own solutions, to which they have full access. Some compromise is necessary. I tell them that they can have an administrative account, with almost full access, so they do not run under full access. That admin account may still have layout access to some layouts, but not to complex ones (ones with lots of fancy portals, invisible fields, etc.). Some clients may just need admin access to a couple layouts, with merge letters, etc.. It is clear to these clients that if they screw it up it will cost to fix it. As Tony noticed, you cannot script entering Layout mode. The only way for someone to get there is to either hit the command keys or the little popup menu in the status bar. And both of those only work if the user also has "All" Available Menu Commands. "Editing Only" blocks them. Since there is no script step, there's no way to give them a button, like there is with Find or New Record. This makes sense kind of. Because there is so much power associated with Layout mode that only the developer and optionally the next lower level should have it. They could put any field, which had not been specifically protected from modification in Privileges field access, and change its value; there'd be no place to hide. There would also be a touchy situation if you ran a "Enter Layout Mode" step and the script ran with Full Access Privileges. Would it apply to just that layout? (I would think yes). Would it override ALL limitations on field access? Undoubtedly yes. FileMaker seems to be able to handle layout switches. If you allow access to a layout, then try and switch to another layout while in layout mode, you can do so. But as soon as you click you get the standard access privileges dialog telling you that you don't have access.
SteveB Posted April 14, 2005 Posted April 14, 2005 It actually can be done on a PC using WinBatch or AutoIt (a keystroke recorder), but the other posters are right...users are dangerous. Steve
Tony O Posted April 14, 2005 Author Posted April 14, 2005 Agreed to all the above - Fenton has put the situation clearly that applies to the vast majority of Developers and their clients apps. You can't script going into layout mode and you can't back door it with an applescript. And like he said to start his reply, "there are all kinds of situations". In this case, I've minimized any damage that the user can do by requiring the person editing the layout to log in with those privileges only in those cases where they're "tweaking" the print layout. Other times they are plain vanilla user. And, it's too bad that dropping into layout mode via script isn't available for these situations; since normal users are usually locked out from layout mode anyway. It's on my wish list, and if I can find another way to backdoor it, I'll do so. Thanks Fenton! Tony
Tony O Posted April 14, 2005 Author Posted April 14, 2005 [quote There are some other ways that you can fine-tune your report layout to get it to print correctly on virtually any printer and in any situation.
Fenton Posted April 14, 2005 Posted April 14, 2005 If this is on a Mac, you can do it with a button running a Perform AppleScript: do menu menu item "Layout Mode" of menu "View" It will fail if run as a script step however. And you can't give them a button to re-enter Browse mode, for obvious reasons :-]. But practially any script could (or the Status bar popup menu, or the command keys).
Tony O Posted April 14, 2005 Author Posted April 14, 2005 If this is on a Mac, you can do it with a button running a Perform AppleScript: do menu menu item "Layout Mode" of menu "View" It will fail if run as a script step however. And you can't give them a button to re-enter Browse mode, for obvious reasons :-]. But practially any script could (or the Status bar popup menu, or the command keys). Thanks Fenton, that's right - it does fail if run as a script step "perform Applescript" - so saving the script from Script Editor as an app and using the script step "send event" is the only way to work it. And it works great! It did not even occur to me to try do menu and even if it had I would have never have guessed that I would have to run it as an applescript "outside" Filemaker. That's awesome. Thanks again! Tony note- couldn't run it as a button as there are other steps in the script. So those steps run, and the last step is the "Send Event" step. -Tony
Dan-A Posted April 15, 2005 Posted April 15, 2005 Someone on this site gave me an idea to adjust position for some label printing... It involved having 2 container fields (one on top of the label, one on the left) then a script that put a different size rectangle in the container field (like font size up & font size down buttons) with the priting/sliding of objects on the form i could adjust my label with great precision. Then there was no need for me to enter layout mode. HTH Dan Found this link with attachment... Link
BobWeaver Posted April 16, 2005 Posted April 16, 2005 Ah yes, I was going to mention that method, but wasn't sure if Tony just wanted to nudge the whole layout back and forth or allow users to completely change things around.
Tony O Posted April 18, 2005 Author Posted April 18, 2005 Ah yes, I was going to mention that method, but wasn't sure if Tony just wanted to nudge the whole layout back and forth or allow users to completely change things around. That's EXACTly what I need it to do! Thanks Dan A and Bob! Tony
Recommended Posts
This topic is 7160 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 accountSign in
Already have an account? Sign in here.
Sign In Now