6 Replies Latest reply on Aug 19, 2014 6:24 AM by B_1

    Scripts that specify for a certain computer



      Scripts that specify for a certain computer


           So I have a script that runs a print command. And I want to specify the options, but since there are others on the network that use that script to print items I cannot (due to different printer names and types, etc) 


           Is there a way for me to specify a computer in the script so it know it is my computer and uses the specifications for printing and if it is someone elses computer they will have to manually fill out the specifications for printing each time?

        • 1. Re: Scripts that specify for a certain computer

               You might want to evaluate the MyFMButler plug in for FileMaker as a way to get more precise control over the printing process. I believe this plug in will give you the ability to specify the printer as a step in your script.

               Without this type of plug in, you may need to create a series of short printer specific scripts that have basically two steps: Print Set up[restore] and Print [Restore]. Each script specifies a different printer and/or different print options. Your scripts can then use a set of If blocks to select which print script is correct for the current layout and computer.

               I know of several options for identifying the computer. If you are using FileMaker 12 or 13, Get ( PersistentID ) can return a value unique to each compuer and/or iOS device that is accessing your database. You'd need to capture this value on each computer and store those ID's in records in a table in order to use it to identify a computer.

               With older versions of FileMaker, you might:

               Use Get ( UserName ) if you go to each computer and use preferences to specify different user names that identify each computer.

               Use Get ( AccountName ) if each user logs on to one and only one device as a client of your database.

          • 2. Re: Scripts that specify for a certain computer

                 One alternative that I have used successfully is to not script the print action at all. I use a script that previews the layout and pauses. The user can then continue the script or pull down the file menu and select print. This puts the responsibility on them to select the correct printer and options, but this is also a very familiar scenario for most users as they are used to using the file menu to print from most other applications they might use on their system.

                 The main draw back is that you may need to educate users on the difference between Records Being Browsed and Current Record for some reports that they may need to print.

            • 3. Re: Scripts that specify for a certain computer

                   I'm on a Mac. Don't know about Windows. I set up a preference table that assigns printers to tasks. Then each of my print scripts uses AppleScript to run a shell script that calls LP commands (CUPS). It's tedious but not that complicated to set up. In effect it's a roll my own plugin. I posted the code here a few years ago but there were no takers as far as I can tell. Printing using multiple printers is a serious shortcoming of FileMaker. The preferences table I speak of exists on the client machine so each user, having different printers, could make use of a different setup. Perhaps I'll post the code again. I have dozens of layouts that need to be printed. Most are "General" and print to the printer i designate as General. Then there are cheques and labels. As well there are layouts that should be printed in colour. All these tasks are done by different printers. EDIT: and all I have to do is click on a menu item (Custom Menu) to accomplish this. No dialog whatsoever. No print setup or Print step.

              • 4. Re: Scripts that specify for a certain computer

                     So after a little thinking on it and tinkering with script, I got it to work. It is a simple script and I just got around to actually doing it. Basically I got tired of always selecting which printer/labelwriter I wanted to use for printing different layouts. 

                • 5. Re: Scripts that specify for a certain computer

                       What happens wen a user on a different machine runs this script and doesn't have the same printer? The simplest solution may be to network all the printers. Then you can be sure all users have access to all printers.

                  • 6. Re: Scripts that specify for a certain computer

                         That would not be an issue with this database I am working in. There are two main users that will print. I mainly set this script up for myself so that I did not have to choose which printer to use every time I want to print ( being that I am the main person printing). The other person wanted the option to choose a printer because he has different workstations. I always print from the same printer when using this database. Although I do have some network printers attached to all computers that all users can see, I would have to walk across the whole building many times a day for a single piece of paper.