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

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

Recommended Posts

Posted

G'Day FM Gurus,

I am using FM Pro 11 in a Windows XP pc and trying to export several images from a database to a folder in my PC by following the documentation below:

http://help.filemaker.com/app/answers/detail/a_id/5822/related/1

I tried initially running the following script

Loop

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & JECMCollection adam::Item ID & ".jpg"]

Export Field Contents [JECMCollection::Photo; “$filePath”]

Go to Record/Request/Page [Next; Exit after last]

End Loop

but it gives an error for each record that can not write in the disk.

This is my first experience scripting with File Maker pro so I do not know what is missing in the script above to work properly as indicated in the documentation link

I appreciate any help

Kind regards

Carlos

Posted

You might not need to prepend "filewin:" to the path.

Posted

You might not need to prepend "filewin:" to the path.

Hi Vaughan

If I take "filewin" off like this

Loop

Set Variable [$filePath; Value: Get ( DesktopPath ) & JECMCollection adam::Item ID & ".jpg"]

Export Field Contents [JECMCollection::Photo; “$filePath”]

Go to Record/Request/Page [Next; Exit after last]

End Loop

Then I get container can not be exported

This script works for one record

Go to layout ["two picture"(JECMollection adam)]

Export Field Contents [JECMCollection adam::Photo]

IfI loop it then it will ask me for each record. I would like to avoid that

I appreciate any suggestion

Cheers

Posted

Does the file already exist on the desktop? Look very carefully.

You must include "filewin:" at the beginning of the path.

Posted

Check that the name of the jpeg file does not have any illegal characters in it.

Posted

Some one got caught with the illegal character last week. They had used ":" in the filename, it's illegal on both Windows and Mac - but it is the ONLY illegal character on Mac. One that gets many is the TRAILING SPACE, especially as the filename is being built from data in a field.

Posted

It could be the same issue as here:

http://fmforums.com/...911#entry212911

It is the same problem Consultant but I am using FM 11 in a PC

Does the file already exist on the desktop? Look very carefully.

You must include "filewin:" at the beginning of the path.

I have the same problem by using "filewin:" or without it and suggested by Vaughan and get the following error:

2duyzcl.jpg

Posted

This where I am at the moment;

I am using the following script to extract container JPEGs

Show all the records

Go to Record/request/Page[First]

Loop

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & JECMCollection adam::Item ID & ".jpg"]

Export Field Contents [JECMCollection::Photo; “$filePath”]

Go to Record/Request/Page [Next; Exit after last]

End Loop

Where JECMCollection adam::Item ID is a collumn in teh database with the ID of the photo

and JECMCollection::Photo is where the photo is located in the record

I also tried it without "filewin" and I get the following error for each record:

2duyzcl.jpg

I appreciate any one who can help me to get this script right :)

The following script works but by one

Go to layout ["two picture"(JECMollection adam)]

Export Field Contents [JECMCollection adam::Photo]

For the ones who has tried to help me please have patience with me as this is my first script

Kind regards

Carlos

Posted

Doesn't matter.

Tried to copy the script from : http://fmforums.com/forum/topic/45545-looping-script-to-extract-container-jpegs/page__p__212911#entry212911 to my situation

Show all the records

Go to Record/request/Page[First]

Loop

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & "/Docs/" & JECMCollection adam::Item ID & ".jpg"]

Export Field Contents [JECMCollection::Photo; “$filePath”]

Go to Record/Request/Page [Next; Exit after last]

End Loop

and still got the same error

2duyzcl.jpg

So I still do not know what to do to get it right

Carlos

Posted

Use the Export Field Contents script step, not the Export command,

Posted

I dunno... the dialog saying "Container fields cannot be exported" suggests he's not using Export Field Contents. But I'm happy to take your money... :D

Posted

Why don't you post your file.

Hi Consultant

What file are you referring to?

Cheers

Carlos

Use the Export Field Contents script step, not the Export command,

Hi vaughan

I am using the script step options to configure Export Field Contents

Kind regards

Carlos

I'll give 3:1 odds that it's the space in the file name.

Hi David

Which space are you referring to?

Kind regards

Carlos

Dear all,

Thanks for your time and suggestion so far and hope that you stick with this newbie and get this script working

It is Friday 5PM in Australia and I am heading for the weekend but I will check this again in two days time

Cheers

Carlos

Posted

This is where the problem is:

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & "/Docs/" & JECMCollection adam::Item ID & ".jpg"]

Any one spot it?

"/Docs/" should be "Docs/" because Get (DesktopPath) yields "/DesktopPath/" and that would mean there are 2 slashes together, which of course is an illegal path specification.

NB. - "/Docs/" was not in the original post.

JECMCollection adam::Item ID could still be yielding an invalid character, you need to check what is the content of that field.

Posted

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & JECMCollection adam::Item ID & ".jpg"]

Export Field Contents [JECMCollection::Photo; “$filePath”]

I see two contexts.

Posted

I noticed the 2 contexts aswell, but that shouldn't matter, what will matter is what

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & JECMCollection adam::Item ID & ".jpg"]

actually evaluates to.

Posted

This is where the problem is:

Set Variable [$filePath; Value: "filewin:" & Get ( DesktopPath ) & "/Docs/" & JECMCollection adam::Item ID & ".jpg"]

Any one spot it?

"/Docs/" should be "Docs/" because Get (DesktopPath) yields "/DesktopPath/" and that would mean there are 2 slashes together, which of course is an illegal path specification.

NB. - "/Docs/" was not in the original post.

JECMCollection adam::Item ID could still be yielding an invalid character, you need to check what is the content of that field.

I tried by including "Docs/" in the Set variable and still got "Container Fields can not be exported"

I wonder if it is the fact that only few records have photos most are empty. I can export one photo by right clicking in the form view or by locating in the record and using the following script:

Go to layout ["two picture"(JECMollection adam)]

Export Field Contents [JECMCollection adam::Photo]

Posted

The one that contains the problematic script.

Are you referring to post the FM database? or only a file with the script?

I can see that I can import an script into it but I have not figured out how to export the problematic script.

Cheers

Posted

I'm going to be unbelievably anal and ask that you check that the SCRIPT is actually using the Export Field Contents step, and not the ordinary Export step. Post a screen shot of the script steps to confirm.

Posted

I'm going to be unbelievably anal and ask that you check that the SCRIPT is actually using the Export Field Contents step, and not the ordinary Export step. Post a screen shot of the script steps to confirm.

Hi vaughan,

This is screenshot s requested

2eyuis3.jpg

Posted

I wonder if it is the fact that only few records have photos most are empty.

Aaagghhhhhh!!!!

Yes, that is the problem. Adjust your script to check for empty containers before exporting.

Posted

It's getting hard to remember, but the original error message was about the path.

You will get the "Container fields can not be exported" message when a container field is empty - but this has nothing to do with the original problem.

Posted

Which comes first in the error procedure - the PATH error or the EMPTY CONTAINER error. Logic suggests the empty container is tested first and so the path error is not disclosed.

Having re-read the original post it looks like there was nothing wrong with the path in the first instance.

Posted

Which comes first in the error procedure - the PATH error or the EMPTY CONTAINER error. Logic suggests the empty container is tested first and so the path error is not disclosed.

That's a good question. Why don't you try and see if Filemaker follows your logic.

Having re-read the original post it looks like there was nothing wrong with the path in the first instance.

Now that's a logic that I don't follow. If there was nothing wrong with the path, why was there a path error message?

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