Newbies wayneye Posted April 21, 2003 Newbies Posted April 21, 2003 I am developing a solution for a company that emails and faxes (via eFax.com) a PDF of a FileMaker layout. It will be running on OS X exclusively. Although it seems to be working so far in testing, I have a programming question: In OS X, I have created a Filemaker script using the print/restore command to save a print job as a PDF file (from the OSX print dialog) in a folder called "pdf" in /users/shared/pdf. Then another script in another FM DB goes to this folder and sends the pdf file (by file name) as an email attachment with an accompanying calculated subject line and email message (using the Send Mail command in Filemaker to Apple Mail) to either efax.com as [email protected] or to the recipient's email address, depending on the preferred method of contact for the recipient. I was wondering if this is going to work properly on all Mac OS X systems that run the database, as long as they have that pdf folder created in /users/shared/. Can anyone give me a reason for using a different OS X directory path for saving these pdf files from Print/Restore? (IE: Desktop? or /) I want this to be extremely reliable on all systems. Thanks in advance...
LiveOak Posted April 21, 2003 Posted April 21, 2003 Why not avoid the issue and use a plug-in such as Troi File. With this plug-in you can detect and/or create the needed directory. Troi File also allows you to move and rename files. -bd
cjaeger Posted April 21, 2003 Posted April 21, 2003 simply use "/" or "/tmp" or /private/tmp" these paths are accessible on any OS X system. Since it will be a Mac only System, use AppleScritp instead of troi plugin. This not only saves money, but will allow for checking permissions etc. You will need applescript anyway for interapp communication. you can check the existence /path to special folders as well as the existence of any folder with just a few lines of script: tell app "Finder" set x to path to Temporary Items folder -- (System Folder etc ...) try set y to alias "/Volumes/MegaCD" on error error "Please insert "MegaCD and try again" end try end tell as of Plugins: the most useful plugin for OS X operations is probably Shell Plugin from abstract. And it's free, too.[www.abstrakt.com] FileMaker did not include this in the MacOS X distribution nor did they let you use the send apple event skript step with unix shell commands. Shell scripts make your life on X soo much easier!
dondawg Posted June 17, 2004 Posted June 17, 2004 I have a similar question, I am trying to upgrade a script that worked in OS 9 so that it works in OS X. The previous script called to make a new folder on the desktop from a project code of a record in FMP. It seems to break down close to the end by watching the Event log. For some reason it is unable to complete the script and the folder is not created. Is the : the issue here in the filepath created. It seems that a / is what is being used in cjaeger example above and therefor it might be OS X specific. Here is the code: property FaxFolder "" tell application "FileMaker Pro" set FaxFolder to (cell "gProjectCode" of current record of database "Doctors" & " Fax Folder") end tell tell application "Finder" set theDeskTop to the desktop as text set FaxFolder to theDeskTop & FaxFolder as text try if exists folder FaxFolder as alias then end if on error make new folder at desktop with properties {name:FaxFolder} open folder FaxFolder set view of container window of folder FaxFolder to name close folder FaxFolder end try end tell Thanks!!
Fenton Posted June 17, 2004 Posted June 17, 2004 Terminology has changed a little. Also, it appears that you're trying to create a folder with an entire file path as the name. I changed it into 2 separate entities. I left out the "FileMaker" part (being too lazy to create the file). set FaxFolder to ("Doctors" & " Fax Folder") tell application "Finder" set theDeskTop to the desktop as text set FaxFolderPath to theDeskTop & FaxFolder as text try if exists folder FaxFolderPath as alias then end if on error make new folder at desktop with properties {name:FaxFolder} open folder FaxFolderPath set current view of window FaxFolder to list view close window FaxFolder end try end tell
Recommended Posts
This topic is 7492 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