Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Export to non-existant folder

Featured Replies

OK... trying to figure if I've lost my mind, if the behavior's changed, or if there's some subtlety I'm missing here.

 

Last time I played around with Export Field Contents was back around 2008. If I remember right, when you built your own file path for an Export script step and one of the folders in the file path was missing, Filemaker would throw an error 100 (File not Found) on the export. I ran into this last with Export Records about a year and a half ago in FM11.

 

Right now, I'm building an image export script for a client; he wants to save the images to a predefined folder on the desktop, and alert the user if the folder isn't present. I thought I could trap for an Error 100 right after the Export Field Contents script step, and use that to trigger the alert. 

 

Instead, the script blithely goes through the Export Field Contents step without reporting an error. When I do a search for the image files, they show up in the Filemaker application folder.

 

I couldn't find this behavior documented in the Help file, or in a search on the Filemaker knowledge base, and it doesn't match the behavior I've seen before.

 

Any ideas?

 

As an alternative, I could try talking the client into putting the folder in the user's Documents folder, and use Get(DocumentsPathListing) to check for the folder's presence, but I want to try and do it the client's way if I can.

 

Many thanks!

If you're on windows you can use send event to create the folder

 

The calculation would look something like this:

 

"cmd /c md " & Quote ( Right (Get ( DesktopPath ); Length (Get (DesktopPath))-1) & "Folder Name")

 

 

 

 

post-99156-0-04394000-1362423925_thumb.j

  • Author

Thanks for the suggestion. What happens if the folder already exists? And can you check to see if the folder exists?

 

I can do something similar on the Mac side with Applescript (including checking for the folder), so if this works for Windows, that may be the answer.

 

Thanks again!

The Windows version of FM doesn't offer the same easy OS integration like it does on the Mac with Applescript.  The OS technology is there, FM just doesn't support it.

 

So you can:

- use Send Event to produce a directory listing of the chosen folder to a text file and have FM import that then parse it to check for the folder (no need for a batch file here, one command line can produce the text file to import)

- produce a VBscript from FM and run it through the Send Event to do the checking and create the folder if does not exist.

  • 3 weeks later...

Using the technique I siggested, if the folder already exists it just drops whatever file you're exporting into it. It doesn't overwrite anything or remove anything unless it's the file you're exporting which will of course overwrite the file in the folder if it exists. But basically, if the folder already exists, nothing happens, It just continues on it's merry way without any issues.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.