George from Pittsburgh Posted January 19, 2008 Posted January 19, 2008 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?
Søren Dyhr Posted January 20, 2008 Posted January 20, 2008 Why not: Set Variable [$path; Value "file;" & Get(DesktopPath) & Get(ScriptParamter) & ".pdf"] --sd
bcooney Posted January 20, 2008 Posted January 20, 2008 In the English version, it's "file:" with a colon, not semicolon.
Søren Dyhr Posted January 20, 2008 Posted January 20, 2008 Good spotted, I just copied and pasted! --sd
George from Pittsburgh Posted January 20, 2008 Author Posted January 20, 2008 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.
Søren Dyhr Posted January 20, 2008 Posted January 20, 2008 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
George from Pittsburgh Posted January 20, 2008 Author Posted January 20, 2008 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?
George from Pittsburgh Posted January 20, 2008 Author Posted January 20, 2008 Addendum: I placed the pdf file on the desktop and then ran the email portion to no avail.
bcooney Posted January 20, 2008 Posted January 20, 2008 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.
Søren Dyhr Posted January 21, 2008 Posted January 21, 2008 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
George from Pittsburgh Posted January 21, 2008 Author Posted January 21, 2008 (edited) 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, 2008 by Guest
Søren Dyhr Posted January 21, 2008 Posted January 21, 2008 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
Biomass Posted March 7, 2008 Posted March 7, 2008 Thank you for including the attachment. I have been able to get this functionality to work now that i have viewed your script !
Recommended Posts
This topic is 6102 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now