Jump to content

Path To Images


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

Recommended Posts

Hi, Regarding images on the web and in the database itself,I prefer to use direct references to an images rather than import image i.e.(/images/abc123.jpg) rather than import images into FMp then us the cdml tag ([fmp-image:picture] for eg) I cant find a way to display this image in fmp just using a reference to an image held in a field. Is this possible or do I have to hold both a link and import the image as well?:(.

Link to comment
Share on other sites

Hi there... ok so this is the thing... when fmp stores a reference to a file where does this display ?? can I see the path itself in a text field :( Another reason why I use the direct reference is for web publishing. The path I have stored is a calculation field which generates an image path to the file. This works fine for the web site , but I need to show this refrenced image in the database.

I hope this is clear!! (as mud probably)

example here:

Calculation field is :

If(imageispartno="yes", "/images/"&Category&"/"&altpicure&".jpg", "/images/"&Category&"/"&picture&".jpg")

This gives result "/images/hats/redhat.jpeg" or "/images/hats/bluehat.jpg" for eg.

If I have a container field in FMp can I populate these fields using the above generated link??

Thanks Eric...

p.s. nice vest Kenneth!!

Link to comment
Share on other sites

Hi:

If you want to show a image in FileMaker, you will have to somehow link it to a container field. This can be done by storing the file directly in a container field, or storing a reference to the file (using the path).

With FM6 you can import file paths into a field when importing from a folder. However, it sounds like you already have the paths in a calc field. You might want to look into the Troi File Plug in because it helps manage external files. You can execute external programs to open the image file at the path specified in you field, but if you want the images to actually show in FM, you can batch import and use a match field to match the image path field to the file path (I think, sorry never tried it). Hope all these images are in the same folder smile.gif

But check it out! Let me know if this helps.

Ken

Link to comment
Share on other sites

If you're on a Mac, you can get the path to a referenced image easily with a Perform AppleScript step.

tell current record of document 1

set m to cell "image"

set cell "Path" to m as text

end tell

(The middle "m" transfer is necessary, don't know why.)

You can also set the "image" cell (container field) from a filepath. But you may not be on a Mac. Troi can set the image from a filepath, and do all kinds of manipulation with the file (copy, move, delete, etc.). It can't do the above however.

You can do most of what you need to just using FileMaker 6. Set up your web images folder. Then just Import Records into FM, using the Folder option (include enclosed folders).

You can bring in a reference to the image, create a local thumbnail in a container field, and get the filepath and file name, all in one shot.

By using Update Matching Records, Add Records, with a match on the file name (don't edit it), you can synchronize with an image folder.

You'd have to set up a new import script for each folder not contained in the main one.

Link to comment
Share on other sites

Thanks Guys , the apple script does work , maybe I have to think about which way round I want to do it.Create pictures then ad the info It could be the way forward.

Just one other point I see the way that the apple script grabs the path from the "image" containder field. So you cant reverse this and set the "image" containers path using apple script???

Anyway thanks for taking the time to respond both solutions have given me some ideas!!! Thanks again. Eric.

Link to comment
Share on other sites

Here's one from one of my files. You need the GraphicsImporter OSAX (Scripting Addition).

http://www.azug.gr.jp/~h-abe/freeware/index.en.html

This script does several things. But I think you can read it and see what they are.

tell application "FileMaker Pro"

activate

-- The above lines not required inside Perform Applescript step, only in Script Editor.

tell current record of document 1

set pictureFileRef to cell "FullPath"

set pictureFileInfo to (info for (alias pictureFileRef))

if file type of pictureFileInfo is "GIFf" or file type of pictureFileInfo is "JPEG" or

Link to comment
Share on other sites

This topic is 6589 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
 Share

×
×
  • Create New...

Important Information

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