Jump to content

Importing pictures from folders, but only the new ..


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

Recommended Posts

I have to import pictures from always the same rootfolder and variable subfolders. Always after I store new pic's from cam, I start a script "Import_new", and the filemaker should import (only references) only the new pic's without a dialog.

First I thought on "xopy /m" (archivbit), but this causes another problems.

Filenamecompare or filedate is not useful, because its random.

Has anyone a good idea for a small solution?

Archivbit is the best indicator if a file is archived or not. But how to check & change it from filemaker without special plugins?

vbs-scripting is a possibilty... but I am a filemaker- and vbs-greenhorn .....

Edited by Guest
Link to comment
Share on other sites

  • Newbies

... or maybe you could use "Update Matching Records" with the "Add Remaining records as New Data", matching on the file name and importing only the thumbnail. Then find the records with an empty file path filed and update them by importing the full image & file path.

Any help?

Link to comment
Share on other sites

... or maybe you could use "Update Matching Records" with the "Add Remaining records as New Data", matching on the file name

This is the same way of mine, but matching on the file path ( surely unique ) and only a step

Link to comment
Share on other sites

your example is the solution ;)-)))).

2 short questions:

1) ImportFromFolder/EditScript/Specify import order/Specify: I did't come in the Specify-Menü. It seems, when I press "Specify" the script starts. Only after deleting the Scriptline "Set...$folder" I come in.

2) In Field Mapping/Match records based on this field you use FilePath = Path. What does this really mean and why not FileName = Name?

Link to comment
Share on other sites

Sorry, I really don't understand your first question.

for the second one, you said:

"I have to import pictures from always the same rootfolder and variable subfolders"

but, in different folders, there can be more then one file with the same name; sure not with the same path.

Link to comment
Share on other sites

thanks ;)-), importfromfolder.zip runs well!

Question: If pic-directory changes, the pic-referenz is lost. But what has do be done, if the pic-directory MUST change, because pc-changes or harddisc-changes? Maybe only HDD D: changes to HDD E: and same direktorys.

Link to comment
Share on other sites

Another way to show an image is to create a calculation which produces its FileMaker-syntax file path, with the result of the calculation "container." When you Import "As reference only", you also get the path to the image file, which is retrievable using GetAsText ( container field ). The full FileMaker-syntax path is the last value (line).

Putting these two facts together. You can use Import Folder to import a folder of images. But, rather than using the reference imported in the normal way, showing it in a container, you can plan ahead, expecting the path to break at some future point; because only the very top of it will change. So you only use the File Path. You plug it into a calculation to show the image.

You do not have to import the image itself at all, just the File Path. Or you can import the image, and use a calculation to get its path, then use that as a starting point.

You can do this in different ways. That is, you can use a global field to hold the drive name, IP, whatever, replacing whatever came in with the original file path. Or you can just use the text File Path field as is, and do a Replace when things change.

It is really the same idea as the original FileMaker "reference only" image. But it's more robust.

ImageAbsolutePath_calc.fp7.zip

Link to comment
Share on other sites

hi fenton,

thanks for your very nice description ;)-).

I tried your "ImageAbsolutePath_calc.fp7.zip". It runs, but I got no pic in the formula-medienfield. I see only the written path of the pic in the pic-field. Example:

filePath: "file://D:/KuSP/Pic/pic1.jpg"

_cImage: "D:/KuSP/Pic/pic1.jpg"

Link to comment
Share on other sites

I don't see why you don't have: imagewin:/D:/KuSP etc.. The calculation was:

Substitute ( filePath; "file://";

Case ( Abs ( Get ( SystemPlatform )) = 1; "imagemac:/"; "imagewin:/" )

)

Check the calculation. Also, in cases where you're importing from a networked folder, you may need 2 slashes at the start. So try adding one and see if that works, i.e., "imagewin://"

Link to comment
Share on other sites

Or you can just use the text File Path field as is, and do a Replace when things change.

first: your formula works fine. I got it!. thxxx. you are great ;)-)).

second: as I understand, in this "robust" solution I have access to the filepath of each pic. But what has do be done, if I change on harddisk the path of 1000 pics (maybe the directory)? Then I must change in 1000 fields 1000 pathes, I think?

Link to comment
Share on other sites

Take a look at the Replace Field Contents command. It acts on all records of the found set. So it is only 1 step to change all the records (of the found set). It is also "not undoable", so be very careful using it. It's a good idea to Save A Copy of the file (if local), or export all the data (if remote) immediately before using it.

Another option, which I mentioned earlier, is to use another field, a global field, as the "drive" part of the calculation (which is the 1st part of the path). Remember, it's a calculation; you can put it together from whatever pieces you want, as long as it produces a valid full path to the image.

Image_gDrive_calc.fp7.zip

Link to comment
Share on other sites

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