Jump to content
donwolfkonecny

Button to Enter Layout Mode?

Recommended Posts

donwolfkonecny

Hopefully I'm just overlooking it, but I can't figure out how an EU can enter LayoutMode from a layout. The script step is suprisingly missing.

 

I have prevented people from editing layouts, but DeptHeads need the ability to edit specific layouts. I have made their rights to edit the layout but I have also made the menu commands basic so they have to use the buttons, and lo, I don't think there is a way to allow them to go into Layout Mode. If I allow them full menu commands then they can go it, but that seems like a navigational thing not a rights.

 

Anyone know how to enter Layout mode from a script or button?

Share this post


Link to post
Share on other sites
AHunter3

Scripts absolutely positively do not do layout mode.

 

No one, and I do mean no one, who can't bother to learn the built-in tools for entering layout mode has any bloody business going there.

 

 

 

Hmm, well maybe possibly conceivably, on the MacOS only, you could perhaps issue an AppleScript command to tell FmPro to enter layout mode... let me see if that's even AppleScriptable?

 

::testing... be right back... ::

 

 

 

OK, it's AppleScriptable:

 

tell application "FileMaker Pro Advanced" to activate

tell application "System Events"

tell process "Filemaker Pro"

keystroke "l" using command down

end tell

end tell

 

Next up: can that AppleScript execute from within an FmPro script?

 

Answer: no. You could perhaps do it FileMaker 2.1 style, do a Send AppleEvent script step to an external AppleScript executable?

 

::testing::

 

Yes, that works. Paste the above into Script Editor, save it as an AS executable (application), then in FileMaker use Send Event, application, that application; do NOT check the checkbox to wait for that process to finish before going on with the script, and DO bring the process to the foreground.

 

 

I still say your end users have no business using a button to go into Layout Mode. That's my opinion and I'm sticking with it.

Share this post


Link to post
Share on other sites
Norma_Snockurs
No one, and I do mean no one, who can't bother to learn the built-in tools for entering layout mode has any bloody business going there ... I still say your end users have no business using a button to go into Layout Mode. That's my opinion and I'm sticking with it.

Seconded. And one of the foremost rules of developing is never let your client stand over your shoulder while you work, so actually letting a user rip in Layout Mode when you ain't there to oversee the carnage seems a mite thoughtless as an understatement!

I guess however everyones circumstances are different and if your boss insists well...

 

If only they gave you a keycode with your FileMaker Certified Developer certificate without which Layout mode was but a distant dream....

Well that's me locked out for a start.

 

and A.H. will that AppleScript work if the Layout Mode menu item has been disabled in Custom Menu's? (it appears it has)

Share this post


Link to post
Share on other sites
AHunter3

I don't think so, because of how it works. It's telling System Events to pretend to be a user going ⌘-L. Which would not work with the menu item disabled.

Share this post


Link to post
Share on other sites
donwolfkonecny

I am trying to administer a database properly and accurately. As such, I don't want them doing things through menus, or by editing data directly (I need to know when they print a record so it doesn't get printed again etc). I have therefore restriced their menu commands to EditOnly which removes their ability to enter Layout mode.

 

However, they need to do mail merges, and update the text each month. This is not possible with a text field because it cannot do MergeFields. So they need to have permission to edit only the layouts assigned to them for mail merges.

 

But FMP can't do this.

 

It seems like you guys are saying I either need to give unrestricted access to menu commands (bad idea) or use Microsoft Word and Excel to do a mail merge.

 

If I want them to only be able to modify certain layouts, I want them to only be able to do that (without being able to print, duplicate accidentally since it's next to F, or export without my managing it). I'm surprised you would suggest that I not be allowed to allow my users to only edit the layouts I want them to without unrestricted access to menu commands.

 

If I can't figure out some way to allow FMP to do this, they have threatened to use Microsoft Word and Excel to do what FMP cannot (or more accurately, will not).

 

Thank you for trying to find an AppleScript way to do this but then I'd have to install it on 30+ computers.

 

Is there some way to manage merge fields not while in layout mode?

Share this post


Link to post
Share on other sites
donwolfkonecny
Scripts absolutely positively do not do layout mode.

 

No one, and I do mean no one, who can't bother to learn the built-in tools for entering layout mode has any bloody business going there.

...

I still say your end users have no business using a button to go into Layout Mode. That's my opinion and I'm sticking with it.

 

Would you say the same for

Open Define Database

Open Define File References

Open ScriptMaker

etc?

 

damn I wish FMP was open source, who's workin on that?

Share this post


Link to post
Share on other sites
LaRetta

You might try using Custom Menus (untested). Their privilege set could determine whether a menu displays for them with View Layout Mode (CTRL-L) ... thin, I know, but I wanted to give you something to work with. Oh Really!

 

I agree we should have an Enter Layout Mode script-step. Why would I want one? For my Developer database ... I grab objects (graphics and such) and would like to paste them quickly into a layout for further study. smiley-laughing

 

LaRetta

Share this post


Link to post
Share on other sites
AHunter3
However, they need to do mail merges, and update the text each month. This is not possible with a text field because it cannot do MergeFields.

 

Says who?

 

Put a handful of buttons to the left of a "Compose Mail" field; when clicked, the button inserts a merge code of your invention that represents where a field value would go. For example §CustomerName§ could represent the value of LocalTable::Customer Name.

 

Then you create a calc field, result type text, defined as a nested bunch of Substitute functions that takes your Compose Mail field and substitutes out all your mergecodes for the field values that they stand for.

 

The field that you actually print out (or email out or whatever) is the calc field, of course.

 

No layout mode necessary!

Share this post


Link to post
Share on other sites
Maarten Witberg

A variation on that theme, here's what I have done a while ago. We send out invoices using filemaker. They are usually standard composed letters. But I wanted to give users freedom to edit the letters to give them a personal touch which is appropriate sometimes. So I stored a standard letter in two chunks; the letter consists of name etc., then an opening block, then a bunch of lineitems, then a closing block of text. These two blocks can be edited. When creating the standard letter, I use something that looks like:

 

set Field [ Invoices::ClosingText ; Evaluate ( Prefs::InvoiceBoilerplateClosingText ) ]

 

The referenced field InvoiceBoilerplateClosingText in prefs is a text field that contains natural language and field concatenation like a normal calc, but allows for editing by power users (where I work, that would be me). I like the idea of the "insert field" button by Allan. Could also be a value list of allowed field names. But you might as well just use the field names directly. You should give users a test drive option so they can see the result of their edits before churning out 1,000 merge letters all with the result "?" in the fields.

 

This further gives the option to non-power users who edit the OpeningText or ClosingText fields to reset them to the boilerplate original. Crude but safe :)

Share this post


Link to post
Share on other sites
donwolfkonecny

Thanks everyone for the ideas!

 

I've found an alternative that I think will make everyone happy (at my end).

 

I've removed the ability to add and delete records, and the ability to print and export. Then I gave full menu priveledges which of course still doesn't all the user to accomplish those items. Then I created scripts for each of those things with FullAccess priveledge set and the accompanying business logic.

 

Also I gave them the ability to edit layouts but only certain layouts.

 

Now, they can use AppleF like they like to, and they can enter Layout mode and edit certain layouts through the menu. But they still can't print export or create or delete records without going through scripts which at least for now seems even better than a LayoutMode button.

 

Again, thanks for the suggestions, they helped me think of it in new ways.

 

dWk

Share this post


Link to post
Share on other sites
josepest

The Answer is simple. Download Autohotkey freeware or similair. Install etc. Open Filemaker, start AutoScriptWrite (recorder) or similair. Record Mouse moves and click on Layout-mode. Stop Recording. Save under a Usefull name like 'Enter_Layout_mode'. In Filemaker You create a script with a scriptstep 'Send Event' where you choose 'File' and specify = add file... your.ahk file. When you start the script it will execute Autokey wich will replay the mouse-move or keystrokes.

 

SnappieVous?

Share this post


Link to post
Share on other sites
sven31

wonderful pice of info.. really helpful///

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

Terms of Use