Jump to content

Scripted Export to Desktop with FMP8


This topic is 6697 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6697 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.