Jump to content
Sign in to follow this  
Jana

Move a file with image links

Recommended Posts

Hello...I've created and populated records for a database on my desktop which has a container field that holds different pdf images in each record. When I inserted the images I checked "Store only a reference to the file". I have the database file and the folders with the referenced pdf's all place in the same main folder.

I want to move the files to another machine for hosting. But when I copy the folder with everything to our server and then copy it to the new desktop of the machine to host, some of the referenced pdf fields in the recoreds say that the referenced file can't be found. It is only on some of them. Some of them are OK. I created a field that shows me the path for each inserted pdf so I could see what it was doing, and it still references the folder on the original desktop location.

Anyway, I would like to udate the database to reference the pdfs from the new desktop location, without having to redo all of them individually. How can I do that? Or is there a better way to move a database file with the referenced files linked to it, that will take care of it automatically?

:qwery: Can anyone give me some guidance please?

BTW: I'm working with 8.0v3

thanks

jana

Share this post


Link to post
Share on other sites

I'm assuming that you don't want to recreate the links individually using the Insert > Picture command from the menu bar.

Assuming that all of the pictures are in the same folder and that you have a field that contains the 'Photo name' you could run a script that loops over all of the affected records and executes something like the following step:

set field [Photo ; "Filemac:/Mypath/Pictures/" & Photo name]

(where 'Photo' is the PDF container field and 'Mypath/Pictures is the new path to your pictures folder)

If you don't have a field 'Photo name' for each record that contains the file name of the referenced photograph you could extract it from the old container reference with a few calculations:

Photo name = Right ( GetAsText ( Photo ) ; Length ( GetAsText ( Photo ) ) - n )

(where n = the number of characters to trim off)

Share this post


Link to post
Share on other sites

Interesting. I haven't used plain Set Field to do this before (except with AppleScript and earlier versions). I always use Insert Picture, using a Variable for the file path.

The below uses an easier calculation to get the file path out of the GetAsText info, using GetValue()

Set Variable [ $imagePath; Let ( txt = GetAsText ( Contain ); GetValue ( txt; ValueCount (txt)) ) ]

Go to Field [ Container ]

Insert Picture [ Reference; $imagePath ]

I noticed that Set Field does not get the image dimensions, whereas Insert Picture does. Minor difference, but perhaps you want those.

You'd want to use "imagemac" instead of "filemac," as the latter will not show the picture, just an icon.

Share this post


Link to post
Share on other sites

Thanks, I'm going to give this and the other suggestion a try. Meanwhile, I went ahead and tested sharing from the file that is the original on my desktop location while I hosted the file, and the desktop trying to share is unable to view any images, even though I can see them on the host machine.

Do you know what's causing that problem. Should I post this question elsewhere?

Thanks

Jana

Share this post


Link to post
Share on other sites

To follow up. You can find out whether a picture exists at the path of the container using AppleScript. First you need to get and convert the FileMaker syntax image path to a Mac style file path.

_cMac_path =

Let ( [

txt = GetAsText ( Contain );

FM_path = GetValue ( txt; ValueCount (txt) )

];

Substitute ( FM_path; ["imagemac:/"; ""]; ["/"; ":"] )

)

Then a simple AppleScript, in a Perform AppleScript step will check if the file is there. You also need a text field (on the layout) to put the result, which will be either "true" or "false". AppleScript:

set Mac_path to cell "_cMac_path"

tell application "Finder"

set exists_flag to exists file Mac_path

end tell

set cell "Exists_flag" to exists_flag

This can be run in a Loop, over all the records. There is a way to create a calculation which shows this, without a Loop. But it requires a plug-in which can calculate whether a file exists or not. A few can.

Picture_Exists.fp7.zip

Share this post


Link to post
Share on other sites

Where are the pictures? On your machine? On the file server machine? If they're on the file server machine everyone on the network would have the same path to the pictures, once the drive is mounted on their machine, so they should all see the pictures, if they have permissions for the folder they are in; probably the Users/Shared folder is good for this.

Is the file server the FileMaker Server machine? This is not really recommended. Because OS File Sharing, required to see the pictures, is not totally 100% compatible with FileMaker Server sharing. It can be done, and it works, but introduces a possibility of corruption (slim but existent).

Look at the file path of the images. That should tell you where they think they are. If not valid, try inserting an image as reference, from the file server into any FileMaker database with a container. Use GetAsText ( container field ) to see the path.

Share this post


Link to post
Share on other sites

:yay: Success! Thank you. Taking the suggestions above, I've come up with a solution to not only host it from another desktop, but supply my images over our main server and automate the file path update.

BTW...do you know a good way to show my small thumbnail pdfs in a list layout with other fields in the record. When I try it, it really makes working my way through that layout very slow. With the single record layout, I can flip through the rolodex with no problem, but showing multiple records with the pdf image on layout is painfull slow.?

Jana

Share this post


Link to post
Share on other sites

Are these really "small thumbnails"? I sort of doubt it, from the fact that you say "pdfs". FileMaker's default option for Format, Graphic is Reduce.* So what you are probably seeing (slowly) is FileMaker having to shrink your full-size pictures on-the-fly to show them in a smaller box. It's still the full-size image, and will take as long to draw as if it was shown actual size (which would be the Crop option).

Basically, for list views you need real thumbnails, which will normally be jpegs. FileMaker can produce these (128x128) and EMBED them (not referenced) during an Import Folder operation. This can be done using the Matching records option, in the Import dialog, using either a unique file name, or a file path. Yes, a little complex, but not overwhelming.

Alternatively you can use AppleScript to do it, on a record-by-record basis. You have built-in image editor in OS X, named Image Events (I don't know about Jaguar, that's kind of old; possibly). It can create thumbnails files from images. Or you can use graphics software, which can do a batch operation on folders; Photoshop (if you're rich), Graphic Converter if you're not).

*Yes, graphics have display options, like other types of data. Look under Format in the Menu Bar, after clicking on the container field while in Layout Mode.

(P.S. Why are you still running Jaguar? Do you want to buy an old eMac cheap? I've got a 700 MHz (kind of slow), running Panther (with full installation disks) that I need to get rid of. I mention 'cause we're both in San Diego.)

Share this post


Link to post
Share on other sites

Thanks, I'll have to take a look at that approach on Monday and see what I can figure out on the thumbnails.

Most of what I do is from the office. I've just been mulling over the fact that I need to get up to speed on technology now that I just, today, secured my permanent place in a high tech company that I've been temporary at for over a year. We're using 10.4.9. here at work.

Ya, my computer at home is pretty old and I get all sorts of error messages from websites for having the old software. It's getting pretty bad so it is on my list this next year to "get with it". I still have dial-up, a 13" tv with rabbit ears, and a pop-up vcr. I know pathetic. :blush2:

Thing is though, I'm not only a geek at heart; although I do love learning about, creating solutions, and solving problems with FM. So, alas, I lag in keeping up with any current technology. I will keep a new/old computer system in mind when I start looking at a change and check in with you when I'm ready. (Maybe after Aruba in May) :smile2:

:backtotopic: Anyway, it will probably take me a while to sort through the thumbnail issue, as I only get to devote a limited amount of time on FM during my day. I'll let you know how I fare though.

Thanks!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.