Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I've got a calculation field (result container) to present a preview of an image file. Field name PREVIEW.

Script =

"image:Previews/" & JobNumberMonthYear & ".pdf" & ¶ &

"image:Previews/" & JobNumberMonthYear & ".jpg"

This all works fine.

I wanted to create another calculation field (called EMPTY) to let me know if the PREVIEW field is empty (in other words there was no file for the PREVIEW calculation to link to) so that i could do a find based on this result and then create these image files.

At the moment, when there is no image showing in PREVIEW it shows the text "The file cannot be found:1115-08".

I have tried a lot of calculations without much joy and can't find any similar problems on any forums.

Appreciate any suggestions.

Posted

There is (to my knowledge) no native calculation that can tell you whether the file actually exists or not. Some of the plug-ins can do this. I know Troi File can. But that's kind of expensive overkill for just this problem. On a Mac you can find out fairly easily with AppleScript.

That attached file shows two different ways to do that. One is to write a calculation that produces the AppleScript, the other just uses a regular AppleScript. Both run via the Perform AppleScript step, and write the result to a field in the current record. Either can be run in a Loop, to do the found set.

File_Exists.zip

Posted

What does a calc set to GetasText( image container field ) return?

Posted

It returns my calculation

"image:Previews/" & JobNumberMonthYear & ".pdf" & ¶ &

"image:Previews/" & JobNumberMonthYear & ".jpg"

whether the PREVIEW field has a linked image or not.

Posted

Well, you can't actually test if it exists natively in Filemaker but you can test if it has zero length - which is probably good enough.

Posted (edited)

Yep i tried to test the length but it returned "0".

If i convert the "calculation/reference field with result container" to a "Container field with a calculation" it returns a length result but doesn't link to my referenced files on the fly.

I'm not all that familiar with AppleScript but will give Fentons idea a go.

But will keep checking back if anyone else has any creative ideas.

JP

Edited by Guest
Posted (edited)

I would go with Applescript. Another option is to go the Previews folder, select all, copy and paste into a text editor. Then import this into Filemaker and relate it to your existing table. This too could be automated, either by Applescript alone or a combination of Filemaker script calling an Applescript.

Edited by Guest

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