If have a legacy Filemaker 9 application. I wrote some scripts in AppleScript to extract all the tables. This works fine.
Now some tables also have images. The result I get in Xojo when calling the script is a Mac PICT memory block. Is there a possibility to convert that into a Picture?
Here is a sample:
«data PICT037C0000000000100010001102FF0C00FFFE000000480000004800000001000100000000200
...
»
I assume that either «data …» or even «data PICT…» is not part of the picture data, but Filemaker stuff.
«data PICT037C0000000000100010001102FF0C00FFFE000000480000004800000001000100000000200
...
»
What I have found out is that a 512-Byte header needs to be added (as Filemaker chops that part when importing image files).
I’ve been trying to make sense of the format, thinking the header must start off with some id, but all I can find about the header is it “contains information that the Macintosh uses to keep track of the file”. It’s possibly unused by now and can just be all 0’s.
And to identify the data in your memoryblock is this info http://fileformats.archiveteam.org/wiki/PICT
A version 1 PICT file has (hex) bytes 11 01 at offset 522, and ends with ff.
A version 2 PICT file has bytes 00 11 02 ff 0c 00 at offset 522, and ends with 00 ff
It is possible in AppleScript to coerce a “resource” (so « data PICT ) into what you want and save it to disk. It’s just that I do not recall the details.
[quote=280469:@Eli Ott]«data PICT037C0000000000100010001102FF0C00FFFE000000480000004800000001000100000000200
…
»
I assume that either «data …» or even «data PICT…» is not part of the picture data, but Filemaker stuff.[/quote]
Indeed Pict documents I have here start with a series of chr(0).
But as it is, Pict is probably using a data fork, as it was common at the time.