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.

Featured Replies

Hi Everyone,

I have inserted many pdf files into a container field through the 'Insert File' command. The PDF icon and name of the file sit nicely there. But I can't for the life of me work out how to simply open the PDF file in it's own program by double clicking the file.

I can manually export field contents, meaning I will create a duplicate of the file and then open it - but creating a duplicate every time I need to open the PDf sounds a bit silly.

Surely there is an easier way?

Thanks so much for your time and help in advance.

Script the process of exporting the field contents to the temp folder with the option to open the file.

I can manually export field contents, meaning I will create a duplicate of the file

If the file is embedded in the container field (i.e. does not exist in your file system) then you must export it first. Double-clicking only works for files that have been inserted as reference only.

  • Author

Thanks Vaughan,

So it is actually impossible to open the same file? In this case it is ok, because it is a pdf, but if it is a .doc that I want to edit, is it really just not possible to open an external document from within FM, that i can open, edit, and save, and always be able to open it from within the FM container field?

Thanks again

  • Author

Ahhhhhhhhh, I got it now. Making a reference to the file is the secret. Question Answered. Thanks a million!

See also (Windows only):

http://www.filemaker.com/11help/html/ole.19.1.html#1027500

  • 2 weeks later...

Hello to all,

I bounce on this subject because I have the same kind of problem on a great scale.

Under Windows, Filemaker 11, 30,000 recordings with a document pdf in a multimedia field, to insert mostly by copy/paste.

I want to automate the export 30,000 pdf to reimport only the link.

To export directly by script is impossible (multimedia field) , how can i make it ?

Thank you for your help and sorry for my English...

Bertrand

To export directly by script is impossible (multimedia field) , how can i make it ?

Very similar to this:

http://fmforums.com/forum/topic/45545-looping-script-to-extract-container-jpegs/page__view__findpost__p__212714

Exporting by script possible with the "Export Field Contents" script step.

You should check if the PDFs have a filename since you imported them via copy/paste. This can be done with a formula: "Get as text( Mediafield )". If that name is empty or only a"?" you have to give them names while exporting; something like the ID of the record. You need a unique name since you can't create folders and will be exporting all files into one folder.

A sketch of the export script:

set var $basefolder = "DestinationFolder"

goto first record

loop

setvar $filepath = $basefolder & "/" & IDField & ".pdf"

Export Field Contents(Mediafield, $filepath)

go to next record(exit if last)

Thanks for yoour help

Get as text give me "?" as you explain, and when i run the script i've got an error message (in french) ;)

Mutimédia field can't be exported.

:idot:

Exporting by script possible with the "Export Field Contents" script step.

You should check if the PDFs have a filename since you imported them via copy/paste. This can be done with a formula: "Get as text( Mediafield )". If that name is empty or only a"?" you have to give them names while exporting; something like the ID of the record. You need a unique name since you can't create folders and will be exporting all files into one folder.

A sketch of the export script:

set var $basefolder = "DestinationFolder"

goto first record

loop

setvar $filepath = $basefolder & "/" & IDField & ".pdf"

Export Field Contents(Mediafield, $filepath)

go to next record(exit if last)

That's because either you didn't set and create the destination folder (if the error starts with the first record) or you didn't manage to create a UNIQUE filename.

That was a sketch and needs adaption for your environment

To be more precise:

If you're on Mac and the HD's name is "Macintosh HD" and you created a folder "exportFolder" on the top level the line for basefolder should look like this::

set var $basefolder = "filemac:/Macintosh HD/exportFolder/"

on windows it will be more like

set var $basefolder = "filewin:/D:/exportFolder/"

as for the IDField part. You must have (or create now) a unique identifier for each record that can be part of a unique filename.

when i run the script i've got an error message (in french) ;)

Mutimédia field can't be exported.

:idot:

It sounds like you are using Export Records[], not Export Field Contents[].

Thanks for your help

:hug:

Karsten Wolf : you're right, i've put Get(DesktopPath) (Obtenir(cheminBureau) en français... and i forgot the folder .....

Comment : No i've used the good export function (Export field Contents)

It seems to be good but i've an error message

I try to translate

xxx.pdf can't be created on this disk, change the name, free space ......

:idot:

xxx.pdf can't be created on this disk, change the name, free space ......

Well, that's a different error message - it indicates a non-valid path for the exported file.

It indicates that a file with that name already exists or you are addressing a folder which does not exist.

If a file with that name already exists, it will be overwritten without any error message.

What is the full path of the error message? Are there some extra "/" where they shouldn't?

Well, i turn mad .... :hmm:

My script :

Set Var $BaseFolder; Obtenir(CheminBureau) get (desktopPath)

Set Var $FilePath ; $BaseFolder&"/"&Test::ID&".pdf"

Export Field contents (Test::doc;$FilePath)

I have on my dektop one folder named "export"

with this config the error message is

You can not export multimedia field

If i script like that

Set Var $BaseFolder;"filemac:/DD1_SkyNet_500Go/export"

Set Var $FilePath ; $BaseFolder&"/"&Test::ID&".pdf"

Export Field contents (Test::doc;$FilePath)

I have the error 800 and the message "1.pdf" can not be created on this disk. Change the name, free space unlock it or choose another disk "

:idot: :idot: :idot:

Insert this before Export Field:

Set Var $FilePath ; "file:" & $FilePath

You have to tell FileMaker what to export. Sorry. I totally forgot about that.

1. If you are on Windows, you need to use "filewin:/" instead of "filemac:/". For a platform-agnostic implementation, use the Get(SystemPlatform) function to calculate the correct prefix at runtime.

2. The result of Get(DesktopPath) function already ends with a "/". If you have folder named "Export" on your desktop then:

Set Variable [ $path ; "filewin:" & Get ( DesktopPath ) & "Export/" & Test::ID & ".pdf" ]

Export Field Contents [ Test::doc ; “$path” ]

should work for you.

Edited by comment

  • 3 weeks later...

Hello

Fist, sorry for the long time, i was submerged by my job .... and now its Christmas ! so Happy Christmas :)

I put an extraction of my problem here. A sample is better than my explaination ;)

ExportMultimediaFile

Thanks for your help

Bertrand

There is no script in your file.

There is no script in your file.

Oups :idot:

MultimediaFile

AFAICT, the problem here is with the actual contents of the container field: it cannot be exported manually. How did you populate the field?

Please attach your files to your posts here, rather than using an external link. External links have a way of getting broken over the years.

Lee

AFAICT, the problem here is with the actual contents of the container field: it cannot be exported manually. How did you populate the field?

That is THE problem !

I think it's by Copy/Paste on a Pc

For the pdf, i find a solution (not very good but ....)

I have a layout in A4 syze and I save it as pdf.

But for the other case i'm in the .....

@Lee Ok sorry

ExportMultimediaField.fp7.zip

I think it's by Copy/Paste on a Pc

It's not very likely. Perhaps these are OLE objects? If so, they could be opened by their native applications under Windows OS.

It's not very likely. Perhaps these are OLE objects? If so, they could be opened by their native applications under Windows OS.

The weight of the base is horrible 6 go i think that means that the picture is realy inside ! :-)

I try under windows but does it change something for export ?

The weight of the base is horrible 6 go

I beg your pardon?

I try under windows but does it change something for export ?

Probably not, but you should be able to save the contents directly from the respective applications.

The weight of the base is horrible 6 go i think that means that the picture is realy inside ! :-)

The french way of saying that the database is 6GB in size (GO = Giga Octets).

6GB is a little too small for 30.000 records. I've exported the 19 records you posted and none of them have a name and the size extracted doesn't match the size reported by the formula "Length(ImageCourrier)". None of the extracted files is pdf data.

Record 17/2603 is visible on OSX. When copying and examining the clipboard a lot of funny types are shown. See attachment. The listed types 'EMBO' (embedded object?), 'OLEP', 'OLER' (Object Linking and Embedding P?R?) hint at some windows mechanism that is responsible for storing the data.

Here are the measured and reported media field data sizes:

Record: 1 size read/reported: 5040 / 97515

Record: 2 size read/reported: 8516 / 81997

Record: 3 size read/reported: 1564 / 65954

Record: 4 size read/reported: 7608 / 42327

Record: 5 size read/reported: 7608 / 40791

Record: 6 size read/reported: 8516 / 606825

Record: 7 size read/reported: 1564 / 22959

Record: 8 size read/reported: 7608 / 40791

Record: 9 size read/reported: 1498868 / 1558154

Record: 10 size read/reported: 8516 / 46662

Record: 11 size read/reported: 1564 / 74650

Record: 12 size read/reported: 8516 / 44619

Record: 13 size read/reported: 1564 / 41375

Record: 14 size read/reported: 8516 / 57407

Record: 15 size read/reported: 8516 / 740422

Record: 16 size read/reported: 1592 / 19698

Record: 17 size read/reported: 1498868 / 3197547

Record: 18 size read/reported: 1564 / 21414

Record: 19 size read/reported: 8516 / 53853

The file exported.zip contains the data I was able to extract.

post-105124-0-29746100-1325299025_thumb.

exported.zip

I've exported the 19 records you posted

How exactly?

Using a Python script. Could have been done with Applescript. To run this you'll need appscript for Python and there are problems with FileMaker 11.

The script:


import sys, os

import pdb

import appscript as asc



fpa = asc.app("FileMaker Pro Advanced.app")

window = "ExportMultimediaField"

layout = "EXport"

layref = fpa.windows[window].layouts[layout]

n = layref.count(class_='crow')

pdb.set_trace()

for i in range(1, n+1):

    recref = layref.records[i]

    recref.go_to()

    media = recref.cells[ "ImageCourrier" ].get_data()

    medianame = recref.cells[ "imageNom" ].get_data()

    medialength = recref.cells[ "ImageLength" ].get_data()

    # ImageLength

    print "Record: %i   size read/reported: %i / %i" % (i, len(media.data), int(medialength))

    name = str(i)

    name = name.zfill(5)

    name = name + ".data"

    f = open(name, 'w')

    f.write(media.data)

    f.close()

    print

I don't think that counts as "exporting".

That depends.

WRT container fields and apple events you are right. Since FileMaker 7 some capabilities are gone. PICT is the only graphics format accepted for reading and writing which is very ironic since FileMaker is owned by Apple and the default behavior since Apple OSX 10.6 is to not work with PICT, the mac standard graphics format. With FMP6 you could read a PICT from a container, convert it to JPEG, pack it up and write it back to save a lot of space. That is gone.

In my book, it definitely counts as "exporting" when using an available API to get data out of FileMaker.

Ahm... but you are not getting data out, only a very small part of it. Perhaps it's only metadata - as will often happen when you copy and then paste into another application.

Anyway, I don't think this thread will move forward until OP or another member opens the file under Windows.

Anyway, I don't think this thread will move forward until OP or another member opens the file under Windows.

Agreed. Thread should continue after #30.

Hello,

First, happy new year and tks for your help Filemaker and for translate ;)

If i understand, i can export image with your script python ?

Perhaps under windows and with an older version of filemaker it will be better ?

Thanks a lot

Bertrand

Sorry, but you can't. It's only on OSX and it was unsuccessful. None of the PDF documents were PDF data. See ZIP file from post #30.

The next thing to try is to manually export a record on the machine where the documents were imported.

If it cannot be done manually, forget about automating it.

Sorry, but you can't. It's only on OSX and it was unsuccessful. None of the PDF documents were PDF data. See ZIP file from post #30.

The next thing to try is to manually export a record on the machine where the documents were imported.

If it cannot be done manually, forget about automating it.

Well, .... :hmm: 2012 begins badly

ok i keep in touch

thanks for all your help

Bertrand

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.