Steve Moore wrote [4/15/05 1:43 PM]:

> Hi Jim,
> 
> Assuming you have stored the file reference and not the file itself...
> Here is a post from Matt Petrowsky which you can adapt to solve your
> problem.

Where's the post?

> It gets a little tricky because GetAsText(YourContainerField) returns
> something like this:
> file:../NameOfFile
> filemac:/Macintosh HD/Users/steve/NameOfFile
> 
> and you have to parse out the beginning part of it, then Substitute out
> any spaces in the filename.
> But it can be done - I set up a very rough demo if you want it.

What?  Okay, when you Insert a graphic image into a FM container field, you
are doing one of two things, depending on the specific choices at the time,
or by the FM script design.

You are either:

A) Inserting by Reference, in which case you _see_ the image in the FM
container, but the image data is stored on the file system in place. If you
move the file, you lose the "pointer" to the file.  What you see is an
internal lossy representation of that data, at that time.

In this case, if you use AppleScript to:

set imgFilePath to contents of cell "imgContainer"

then you will get back:

a string path

class of imgFilePath
--> string

Now, if you want to use that, you an easily do:

alias imgFilePath
-- make a pointer to the real file, will error if no longer there

or you can POSIX file path.


B) Inserting

If you actually insert the data into a FM container, then you do just that.
Now, depending on FM version, that data format is different.  In FM4-6, you
really had a PICT file in there and that was about it. You could (can) spoof
that stuff and you could get all kinds of stuff in there with fake PICT
headers and binary data.

 Boring.

In FM 7, you can put loads of stuff in there and the data is stored rather
directly.



Either way, it is not hard to "get the contents" of a container field. You
just have to pay attention to what those "contents" are -- a string path or
binary data.

Check out the tips files I pointed to and play around to see the
differences.


--
Gary


--
To unsubscribe: send an email to <[EMAIL PROTECTED]>
FMPexperts is hosted by Ironclad Networks <http://www.ironclad.net.au/>

Reply via email to