Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Does anyone know a way to suppress the dialog box that pops up when Insert File fails to find the file in the path? I'd like it to just die quietly. Set Error Capture On doesn't help.

Posted

That's funny, I was just dealing with that same problem today. The problem for me was that the container field on some records would throw up a dialog when I tried to export the field contents -- apparently a side effect of how the image was pasted into the field. No error is generated, so there seemed to be no way to stop the dialog. Since I wanted to loop through and export these images, I resorted to this utility I found:

Push That Freakin' Button (PTFB)

(Apparently an older freeware version, but it seems to work fine on XP. A newer shareware "Pro" version is also available.)

But Chris, I do indeed get an error when I try to import a file that's not available. In fact, that's how I trap for whether my export failed: I attempt to import the file back into a global container field.

Posted

Thanks! I'll try that.

I'll double check my script. I am able to trap an error, but the darn select file dialog still pops up.

Posted

Are you specifying the file path with a variable or what? I don't see why the dialog box should appear when "Specify source" is selected in the import script step options.

Posted

Yes, I'm using a variable to specify the path. Sometimes the file isn't there, and that's expected, but I'd like FileMaker to handle the condition, not punt back to the user to figure out. I've attached an example file.

InsertFile.zip

  • 1 year later...
  • 4 years later...
  • Newbies
Posted

In case anyone else comes across this post (like I just did) while searching for a solution, I found one:

 

• Create a Global Container field

• Put the field on the same layout you're on during the Insert File script (it can be in the non visible scratch area to the right)

• Add the following to your Insert File script, before the Insert File command:

 

  - Set Error Capture [On]

  - Insert from URL [select; No dialog; Table::GlobalContainerField; ""file///Volumes/HardDriveName/PathToFile/FileName"]

  - If [Get(LastError) <> 0

  -     Show Custom Dialog ["The file is unavailable."]

  -     Exit Script

  - Else

  -     Set Field [Table::GlobalContainerField; ""}

  -     Set Error Capture [Off]

  - End If

 

Note: Windows file syntax is: "file:///C:/PathToFile/FileName"

 

Insert from URL DOES suppress the Open File dialog box with Set Error Capture On and returns an error if it fails. The Set Field in the Else clears out the file you inserted so it doesn't take up space in your db.

This topic is 3880 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.