This Filemaker script loops through a found set and then, for each record, creates a text file with a record-related filename in the PrintToPDF preference folder. It then prints a cover page (set up in the 'header' layout). It the opens the cover page in Acrobat Exchange and then attaches the relevant PDF document to the end of the 'Cover page' pdf file.
Note, we use 2 storage volumes for archived PDFs: 'Arab' and 'Camel'. These names mean nothing, they are just names (ARAB started out as Apple Resource Bank, and Camel was used when Arab got too big. For information we hold 2500 documents and deliver about 200 per week to our 43 users.
I picked up Applescript just to do this. I haven't used it before or since. My previous experience was with Frontier (cool) and ASP though my current work straddles Lasso and PHP (real newbie though).
Now to the AppleScript. ===============================Go to Record/Request/Page [First] Loop Go to Related Record [Biblio Extract][Show only related records] Perform Script [Filename: "LBib_Extract.fp5" (xxx.xxx.xxx.xxx), "Stored"][Sub-scripts] Set Field [DeliveryBatch, HEI_Contacts::DeliveryBatch] Perform AppleScript [Script Attachability: Script Text: "tell application "FileMaker pro" set filename to (get data cell "storage_filename" of current record of document "LTransactions.fp5") & ".pdf" tell application "Finder" set pathname to "CACTUS:System Folder:Preferences:PrintToPDF Output File Name" make file at folder pathname with properties {name: filename} end tell end tell"] Print Setup[Restore setup options, No dialog] Go to Layout [Header Page] Print[No dialog] Go to Layout [TU Processes Mac][Refresh window] Perform AppleScript [Script Attachability: Script Text: "tell application "FileMaker Pro" set myPath to "H" set foldername to (get data cell "DeliveryBatch" of current record of layout "TU Processes" of document "LTransactions.fp5") set myHeaderpage to ((get data cell "Storage_Filename" of current record of layout "TU Processes" of document "LTransactions.fp5") & ".pdf") set myStoragename to ((get data cell "Storage_Filename" of current record of layout "TU Processes" of document "LTransactions.fp5") & ".pdf") set mydocname to ("Lex" & (get data cell "BLDSC Lex Ref" of current record of layout "TU Processes" of document "LTransactions.fp5") & ".pdf") tell application "Finder" if not (exists file mydocname of disk myPath) then if not (exists file myStoragename of folder "Archive" of disk "Arab") then if not (exists file myStoragename of folder "Archive" of disk "Camel") then tell application "FileMaker Pro" do script "no_file_ready" end tell end if end if end if end tell end tell tell application "Finder" if exists file myStoragename of folder "Archive" of disk "Arab" then set name of file myStoragename of folder "Archive" of disk "Arab" to mydocname copy {file (mydocname) of folder "Archive" of disk "Arab"} to disk myPath delete file mydocname of folder "Archive" of disk "Arab" end if if exists file myStoragename of folder "Archive" of disk "Camel" then set name of file myStoragename of folder "Archive" of disk "Camel" to mydocname copy {file (mydocname) of folder "Archive" of disk "Camel"} to disk myPath delete file mydocname of folder "Archive" of disk "Camel" end if set mydocname2 to myPath & ":" & mydocname set myHeaderpage2 to myPath & ":" & myHeaderpage tell application "AcrobatT Exchange 3.0" activate open alias myHeaderpage2 with invisible open alias mydocname2 with invisible tell document 2 set HowManyPages to (count each PDPage) end tell tell document 1 set myLastPage to 1 insert pages from document 2 starting with myLastPage number of pages HowManyPages after myLastPage end tell close document 2 save document 1 close document 1 end tell tell application "Finder" if not (exists folder foldername of disk myPath) then make folder at disk myPath set name of folder "untitled folder" of disk myPath to foldername end if copy {file (myHeaderpage) of disk myPath} to folder foldername of disk myPath delete file myHeaderpage of disk myPath if not (exists file myStoragename of folder "Archive" of disk "ARAB") and not (exists file myStoragename of folder "Archive" of disk "Camel") then copy {file (mydocname) of disk myPath} to folder "Archive" of disk "Camel" set name of file mydocname of folder "Archive" of disk "Camel" to myStoragename end if delete file mydocname of disk myPath end tell end tell"] Insert Current Date [Header added][Select entire contents] Perform AppleScript [Script Attachability: Script Text: "tell application "FileMaker pro" set filename to (get data cell "storage_filename" of current record of document "LTransactions.fp5") & ".pdf" tell application "Finder" set pathname to "CACTUS:System Folder:Preferences:PrintToPDF Output File Name" delete file filename of folder pathname end tell end tell"] Insert Calculated Result [Doc supplied, Status(CurrentDate) +1][Select entire contents] Go to Record/Request/Page[Next, Exit after last] End Loop
In reality the script then calls a subscript which handles FTP of the folders to my NT FTP server using Fetch.
Listers may be more interested in a one-off PDF builder which can then be delivered to the user. You'll just have to cut out the unneccessary code from above and customise it to your own needs.
I am currently working on a Lasso/PHP document delivery method where Lasso handles the authentication and PHP does the actual delivery. Cookies allows the 2 to communicate. My initial tests were successful.
Hoping this helps someone.
By the way, If you want real Lasso help, rather than Studio help, you should join the Lasso talk list.
Regards
George Pitcher
Technical Manager HERON Project Napier University Edinburgh EH10 5DT
http:////www.heron.ac.uk =============================================== programmer - A device for transmuting caffeine into code. =============================================
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http:////mail.yahoo.com
----------------------------------------------------------------------- To Unsubscribe: <mailto:LassoStudioDW-off@blueworld.com> List Archives : <http:////listsearch.blueworld.com/LassoStudioDWSearch.lasso> Blue World Support Central : <http:////support.blueworld.com/> Support Inquiries: <http:////support.blueworld.com/supportinquiry.lasso> Note: Lasso Studio for Dreamweaver Talk is not an official technical support forum.
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!