gregincolumbus Posted December 15, 2005 Posted December 15, 2005 I want a simple export of data to go to the desktop. The fields are pre-determined in the script...the user simply launches a script and the export is done. I know in 6 and earlier, you had to export to a known location then use a file plugin to move the file to the desktop. Can this be done now in FMP8 using the get(desktoppath) function without using a file plugin? Also, would this be platform independent? Thanks Greg
Fenton Posted December 15, 2005 Posted December 15, 2005 Yes, it can be done and it is platform independent. You use the Get (DesktopPath) & the file name (add folder path if needed) to produce a FileMaker syntax file path. Put that into a named variable, with the Set Variable step during the script (Control section of script steps). Put the named variable in the dialog for Export file path (no quotes). ExportwDate.zip
gregincolumbus Posted December 15, 2005 Author Posted December 15, 2005 Fenton Thank you so much...after years of developing in 3-6, migrating to 8 has been a brain teaser.....the power is obviously there but the actual writing is not so obvious : (well at least for me) Thanks for you reply and attachment. It is EXACTLY what I wanted! Greg
Fenton Posted December 15, 2005 Posted December 15, 2005 Yes, going from 6 to 8 is quite a jump. As far as using Set Variable, you're not alone, I also had to have it pointed out to me (after I was whining that such ability was not there). It is much the same situation with using calculations to display images and files, which was added in 7; many people don't know it's there yet. Neither is mentioned in FileMaker Help or manuals (I couldn't find it anyway). The Variable file path can be used in any of that type of dialog, Export, Import, Save As Excel, Save As PDF, Export Field Contents.
dondawg Posted December 15, 2005 Posted December 15, 2005 I have a similar question of sorts. Is there something I should know about exporting to desktop and the import function as well for that matter when using OS X versus OS 9. It seems my scripts that were set up in OS 9 are now broken in OS X. I assume it is a file struture difference between the two operating systems. What confuses me is this.... Even after I have gone back into the scripts in OS X, done an initial manual export to the desktop, opened the scipt back up, reset the file name and location in the script and clicked "replace" upon closing the script. Then done the same for the import function in the associated file. I am able to have the scipts run correctly but this is only on the one machine I reset the scripts. I should say my solution is hosted (FMP 6 Server). If I remember correctly, once I had done this on one OS 9 machine accessing the server I did not have to follow the same process for each desktop. Does the fact that OS X's file stucture uses USERs cause this much problems. If so will I have to do it on each desktop or for that matter only run these scripts from one desktop as I can see FMP locally not really being able to remember the script values for each machine. Is there anyone that understands and knows what I am talking about or I just crazy? : If I am not crazy then can anyone point me towards a global solution. Thanks!
gregincolumbus Posted December 15, 2005 Author Posted December 15, 2005 Fenton Thanks again for the info...I tried using the file you supplied on Windows XP but got the dreaded..."this file cannot be created on this disk...rename, unlock...etc" Any ideas? Thanks Greg
Fenton Posted December 16, 2005 Posted December 16, 2005 First, I take it all back FileMaker. There is indeed a comprehensive explanation in the Help, under "Creating a Database" then "Creating file paths", with a link to the next section, "Using Variables". Greg, I don't have a Windows machine handy (soon will). Take a look at what the calculation produces. I left off the "prefix", so maybe it requires that on a PC? It does seem to need it for a relative path on a Mac. Try it with the prefix "filewin:" before the desktop path. dondowg, yes it's the user. OS X is a multi-user operating system, OS 9 is not. Every user in OS X has his own user folder with his stuff in it, which stuff includes the Desktop. So you cannot expect to export to the desktop directly via a script which runs on multiple clients and expect the file path to be valid. Using FileMaker 6 and OS X is kind of a pain doing these kinds of things for that reason. FileMaker 6 hides the file paths in its script steps, and offers few useful tools for this stuff, other than Status (CurrentFilePath). FileMaker 7 shows you the file paths. FileMaker 8 goes further, and lets you calculate Get (DesktopPath). There are work-arounds however. There is a folder which everyone on OS X should have access to, which is the Shared folder, just inside the Users folder . It's there for this purpose. You can export to there, then use AppleScript, in a Perform AppleScript step, or a calculation field, to move the exported file to the users desktop. It's a little more work to rename the file. tell application "Finder" move file "Macintosh HD:Users:Shared:Exported_file.ext" to desktop end tell ExportToDT5.zip
gregincolumbus Posted December 19, 2005 Author Posted December 19, 2005 Fenton Thanks again..that did the trick...adding "filewin:" in front worked fantastically! I even tested using a hosted setup with no problems. The same logic worked great for saving to the documents folder with get(documentspath) call. I appreciate you help! Greg
Recommended Posts
This topic is 6915 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