January 19, 200817 yr Set Variable [$path; Value "file;" & Get(DesktopPath) & "Name.pdf" Save Records as PDF [Restore; Append: No dialog; "$path"; Records being browsed] I would like to replace "Name" with a Parameter or calculated expression. Any thoughts?
January 20, 200817 yr Why not: Set Variable [$path; Value "file;" & Get(DesktopPath) & Get(ScriptParamter) & ".pdf"] --sd
January 20, 200817 yr Author It worked wonderfully! Thank you. My problem now comes when I try to declare the path to attach the pdf file for emailing. I tried file:"Get (ScriptParameter) & .pdf" but this is not a path to an existing file. Any thoughts? A solution will make my script fully dynamic.
January 20, 200817 yr Careful here, the quotation mark should be just in front of the .pdf not in front of Get( ...because you then prevent evaluating the script parameter to evaluate! --sd
January 20, 200817 yr Author sd, Thanks; I made the correction. file: Get(ScriptParameter) & ".pdf" However, it still won't make the attachment I want. Is it because at that point in the script a file - file: Get(ScriptParameter) & ".pdf" does not exist on the desk top. Should I have the script place the file on the desktop first and then let the mail portion execute? Or am I totally misunderstanding the mailing function?
January 20, 200817 yr Author Addendum: I placed the pdf file on the desktop and then ran the email portion to no avail.
January 20, 200817 yr Well, now your file is on your desktop. It's name is: scriptparameter.pdf. To retrieve it, it's file: & Get(Desktoppath)& scriptparameter & ".pdf" If your goal is to save a record as a pdf, then email it, you don't need to export and then import. Use the Save as PDF with the option to create an email with the file as attachment. You might consider saving the file to Get(TemporaryPath) rather than Desktop. This way the files don't accumulate on the desktop. The OS will delete the contents of the Temp folder at shutdown.
January 21, 200817 yr Of the same command, no when you use that will there only be created a new mail, lacking all the rest. But instead should you use this step just after what you have accomplished until now: http://www.filemaker.com/help/ScriptsRef-262.html Give it a stab, and then use this when you wish to delete the attachement after sending the e-mail. http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000819 --sd
January 21, 200817 yr Author I'm so close. Using the following file paths, with Content Area List.pdf on the desktop and $$ScriptParameter = Content Area List; the attachment works for the second option, but not the first. file:$$ScriptParameter &."pdf" file:Content Area List.pdf It must be syntax, but I can't seem to get it right. None of theses work. file:& Get(DesktopPath) & ($$ScriptParameter) & ".pdf" file: & ($$ScriptParameter) & ".pdf" file: & $$ScriptParameter & ".pdf" file:& Get(DesktopPath) & $$ScriptParameter & ".pdf" Edited January 21, 200817 yr by Guest
January 21, 200817 yr Alright you need to omit the extention, I couldn't remember that. Take a look at the template I attach... does all I suggested. --sd ToPittsburgAndBack.zip
March 7, 200817 yr Thank you for including the attachment. I have been able to get this functionality to work now that i have viewed your script !
Create an account or sign in to comment