12 Replies Latest reply on Mar 27, 2015 8:53 AM by philmodjunk

    Save as PDF status toolbar override

    MariusPirv

      Title

      Save as PDF status toolbar override

      Post

      Hello,

       

      I'm using Filemaker 13.04 on Windows.

      I have a few records that need to be printed and in the printing window I also show up the Status toolbar (Save as PDF).

      I would like to be able to modify(override) the script behind this toolbar button in order to save the PDF with a specific name to a specific location, the name would change the location not.

      Or to create a whole new button from ground up which will basically to do the save as PDF part and the ones as above.

       

      Please let me know if this is possible.

      If I was unclear or ambiguous let me know and I'll try to explain it different.

       

      Thank you.

        • 1. Re: Save as PDF status toolbar override
          philmodjunk

          There are two parts to your task: 1) Saving as PDF to a predefined field name and 2) setting things up so that clicking the Save As PDF (or selecting that option from the File Menu) will do 1).

          1) can be done, but with the following caveat: When you use this method, you don't just specify the file name, you are also specifying the location to which it will be saved. A folder in Documents or on the Desktop often makes a good location for this purpose unless you are only saving it long enough to insert into a container field or attach to an email. In that case the Temporary folder makes a good choice. There are get functions that calculated the full file path to all three of these folders for the current computer, both mac and Windows. See this script for an example of how to do this: Found Sets to PDF with unique file names

          2) is possible, but only if you have a copy of FileMaker Advanced. With advanced, you can set up your layout(s) with a custom menu where you substitute your script in place of the original menu option. If you do this right for a given layout, all keyboard shortcuts, menu picks and tool bar icons for that custom menu option will run your script in place of the original option.

          • 2. Re: Save as PDF status toolbar override
            MariusPirv

            Thank you for the explanation :D.

             

            For the 1) I already planned to have a permanent server location where to save the PDF so this will be static, except the name of the PDF.

            Now comes the tricky part.

            I've tried with FM Advanced to create a new File menu and to replace there the Save/Send ->PDF with my script. Everything is ok until I set it to execute my custom script, then it goes back to default. So I can change the name from "Save as PDF" to "Save PDF" and the toolbar icon will update, but when I put my script instead of default it will change back to default "Save as PDF" and will execute the default script.

            My problem really is that I need to run my script from this status toolbar icon, because in the print layout I don't have access to menu (File,Edit..). Therefore I need to override this Save As PDF icon.

             

            Please give it a try with the advanced version and see if you hit the same issue I did. :(

            If there is any way of doing this (working) please let me know.

            Thank you

            • 3. Re: Save as PDF status toolbar override
              philmodjunk

              I've frequently modified standard menus to perform my own scripts, but something you posted has me confused:

              because in the print layout I don't have access to menu (File,Edit..)

              Can you describe that in more detail? What is keeping the menus from being available while still showing the icons in the status toolbar?

              I can't quite conceive of a way to get the status tool bar but not also have the menus accessible...

              • 4. Re: Save as PDF status toolbar override
                MariusPirv

                I've created a new window from a window and I think I disabled the menu view. Anyway I want it to be this way so you can't access menu from the print preview..

                What I need is that Save as PDF from the picture to run my custom script behind so I can set a static save location and a Dynamic name and maybe a msg only to say PDF saved after click.

                Do you think its possible ?

                 

                Thank you for your patience :D

                • 5. Re: Save as PDF status toolbar override
                  philmodjunk

                  And how did you "disable the menu bar"?

                  I don't see a  way to do that short of publishing to the web via WebDirect--which I can tell from your screen shots is not the case. As I've previously posted, Simply setting up a custom menu for the layout shown in your screen shot should enable you to perform a script of your design in place of a standard menu option.

                  Sometimes I need to change "Show All Records" to "Show All Records not marked Delete".

                  In such cases, I do the following.

                  Write a script that finds all records not marked delete.

                  Open manage/Custom Menus and create a new custom menu set.

                  Find the copy of the Records menu and open it for editing.

                  Select the Show All Records menu item

                  Click all three check boxes under "Override default behaviors" and for the "action" check box, select my script as the script to run in place of the Show All Records standard action.

                  That's it.

                  But in your case, this menu option is inside a sub menu and I don't see any way to create a customized copy of that sub menu.

                  So you might be better off hiding the status tool bar and putting a button on your layout to do your save as PDF.

                  • 6. Re: Save as PDF status toolbar override
                    MariusPirv

                    I did this "New window" thing with a floating document and it doesn't show the File menu in Preview mode.

                    I understand the button part, I tried this, but I could not find a way to see the button in Preview mode, but still not print the button( I've checked the "Hide when printing").

                    So if there is a way to have a button in preview mode that I can click (Like "Save as PDF"), but won't show up when the document is actually printed, that would be great.

                    Sorry if I don't know everything very well, I'm new to filemaker :).

                    Thank you

                    • 7. Re: Save as PDF status toolbar override
                      philmodjunk

                      you don't need to put the button on a layout being viewed in preview mode. Keep the layout in browse mode, or open a show custom dialog where the user can click to run this script or open a small floating window with this button on it.

                      I've used those new window options, but none that I see make the entire menu bar disappear and your should still be able to select this menu option from the File Menu while previewing the layout. In the attached image, you'll see the bottom part of the file menu with Save As PDF exposed for selection while you can also see that the window is in preview mode.

                      • 8. Re: Save as PDF status toolbar override
                        MariusPirv

                        I know about the option with File, but it was made like this and I can't change it on my version :(.

                        The only thing that would be acceptable would be modifying/creating a new button as "Save as PDF" and include it in the status bar.

                        Or create a button to include in the layout and somehow not show it when I prints.

                         

                        Thank you for everything :D

                        • 9. Re: Save as PDF status toolbar override
                          philmodjunk

                          So is the  menu bar always gone? That was not what I understood from your earlier posts. If so, this is in Kiosk mode.

                          I will note that I described two other alternatives to the FIle Menu and both should still work here.

                          • 10. Re: Save as PDF status toolbar override
                            philmodjunk

                            And something else just kicked in. You have FileMaker Advanced, you have the ability to open the file in Full access mode or you wouldn't be able to open the file and make changes to it's design...

                            Therefore "it was made this way and I can't change it" simply cannot be the case. If you have advanced and you have a full access account, there is nothing that can keep you from taking the file out of Kiosk mode.

                            • 11. Re: Save as PDF status toolbar override
                              MariusPirv

                              No, you understood good at first.

                              I have full access and the file menu does show up, just not in this print preview. I cant change it because I'm working on a version of "how the client wants it", and was made before ( like 1.0, and I'm doing 1.1) :D.

                              Therefore the only viable options are the one I listed in the other comments. Are any of those 2 possible ?

                              Thank you

                              • 12. Re: Save as PDF status toolbar override
                                philmodjunk

                                Please explain your "print preview". I've been assuming that you have been putting the layout into Preview Mode. But now I think that you are selecting "preview" from a print dialog. If so, don't do that. Use preview mode and now you still have access to the controls and menu options on the layout.

                                This really shouldn't create an issue for your client as this still shows them how the layout will look when saved as PDF. If it does, you'll have to present them with a choice: Either they don't gain this capability, or they allow you to change the approach.

                                I've done a lot of consulting and handling unreasonable/uninformed user requirements definitely requires finesse and sometimes there is just no way to get them to agree, but keep in mind that they have hired you for your expertise and thus need to respect that when you indicate that a different approach is needed in order to get to the end result that they need--even if it's not exactly via the method that they originally specified.