8 Replies Latest reply on Oct 5, 2010 12:35 PM by MStephens

    Script Help



      Script Help


      My database is on an FM server.  I have an email script for registration confirmation.  I use to be the only one that used it.  The PDF was saved on a shared folder.  I had a filewin and filemac line to save.  Now the FS1 here at work is overriding permission's and the IT's have not figured it out.  In the meantimes I would like to save the PDF locally.  There are 4 of us that would be using this script.  I do not, if possible, want 4 lines going to each user, but rather would like to have 1 line that whoever was on, it would recognize their username and save.


      filewin:/C:/Users/jdoe/Desktop/2009 Registration Confirmation.pdf

      filewin:/C:/Users/jsmith/Desktop/2009 Registration Confirmation.pdf

      filewin:/C:/Users/tdoe/Desktop/2009 Registration Confirmation.pdf

      filewin:/C:/Users/tsmith/Desktop/2009 Registration Confirmation.pdf

      How could I combine into one line, or am I 'stuck' with 4 lines?





        • 1. Re: Script Help

          Use the Function Get ( DesktopPath ). It will return the path to the current user's desktop directory and thus all you'll need to do is append the name of the PDF file to this path .

          • 2. Re: Script Help

            could you please give me an example using the above line?

            • 3. Re: Script Help

              Set Variable [$Path ; Get ( DeskTopPath ) & "2009 Registration Confirmation.pdf" ]

              Now use $Path in your Save a PDF step.

              Save Records as PDF [ no Dialog ; "$Path" ....

              • 4. Re: Script Help

                I am such a newbie at this, sorry, I am sure people with more experience will understand the above, but I am totally lost.  I need simplistic step by step.

                Below is my email confirmation script:

                go to layout (which is the registration form)

                Print Setup (to have it save in portrait)

                Save records as PDF (this is where the 4 lines above come in)

                Send Mail (I sent via our email client, I use email field name, I specify what to attach, which is the PDF saved on one of the four desktops, so the same 4 lines above are repeated)

                Enter Browse Mode

                Go to Layout (origianl demographic layout here)

                Enter find mode (i begin again)

                If you could help me a bit more in setting up this string of instructions for the save records as PDF and the send email, if possible, and if you have the patience to do so with a newbie, I would so appreciate it.

                • 5. Re: Script Help

                  I may be misunderstanding what you are trying to do here. Do you want to run this script once and place a copy in all four locations? Or do you want each user to be able to run this script on their own and successfully save it to their desktop?

                  I assumed the second option, but now think you want the first.

                  A simpler options might be to define a directory on one of the four machines and share it so that all 4 users have access to it. Not sure from your original post whether that's a possibility here or not.

                  • 6. Re: Script Help

                    I do want the second option

                    I did define a directory on our file server, but IT are having permission issues, One of the users, data entry only, for whatever reason, seems to override permissions.  If I am using the send email script, I am okay, UNTIL she uses it, then I no longer have permission to save, nor does the other person.  YET when the other person or myself use it, we do not cancel each other out, only when 1 uses it. 

                    IT does not have 'time' at the moment to find out what is happening, so, i thought I could have the PDF saved locally on each machine as each person uses the database, enters info, and runs the send email script.  the PDF is resaved everytime a new entry is made. 

                    The database is on a FM server, so there is no need for 'sharing' persay, we each have a password to get into the database and enter.

                    The four lines seem to be working in the save as PDF and the send email, I was just wondering if there were a shorter version, in case another persons enters info on a different computer with a different user name, they would not get an error message and I wouldn't have to have line upon line with the same infor EXCEPT for the users actual name.



                    • 7. Re: Script Help

                      I didn't suggest sharing the file on the server but rather on one of the 4 workstations as a temporary work around.

                      go to layout (which is the registration form)
                      Print Setup (to have it save in portrait)
                      Set Variable [$Path ; Get ( DeskTopPath ) & "2009 Registration Confirmation.pdf" ]
                      Save Records as PDF [ no Dialog ; "$Path"]//specify whether current records or records being browsed as appropriate
                      Send Mail [send via email client ; To: someone@domain.com ; Subject: "Your subject here" ; Message: "any message you have"; "Path"]
                      Enter Browse Mode
                      Go to Layout (original demographic layout here)

                      In the Save Records as PDF step, click the upper Specify Button (Specify output file) and type in $Path (no quotes).
                      In the Send Mail step, fill in the appropriate boxes for to, subject and message. Attach the file, by clicking the specify button at the very bottom and once again type in $Path (no quotes) to specify the path to the attached file.


                      • 8. Re: Script Help

                        Thank You, it worked!!!!!!!