Help with custom properties (or something like that)

Sarah Reichelt sarah.reichelt at gmail.com
Sun Apr 16 19:04:02 EDT 2006


>    I'm working with MetaCard 2.4.1, running under MacOS 9.0.2 (it serves my
> needs, what can I say?). I have a stack with a custom property called
> "AdMailTemplate". This property contains a file. I know it's *in* there, because the
> statement "answer the length of (the AdMailTemplate of this stack)" gives me the
> length of the file... but "answer (the AdMailTemplate of this stack)" gives
> me *nothing*.
>    I've tried using base64Encode on the file before storing it in the
> property, and base64Decode after retrieving the stored file. This was a partial
> success; "answer (the AdMailTemplate of this stack)" no longer gives me bupkiss,
> but it base64Decodes to nothing.
>    What the heck is going on here? Why should a custom property behave like
> that? Is it possible that there's something weird about the content of said
> custom property which MetaCard doesn't like? Would it make any difference if the
> file contains nulls and/or other funky characters? Is it possible that the
> file's bytes have coincidentally copied some portion of the MC2.4.1 stack file
> format?
>    I sure hope this is a known flavor of bug with a known solution, that
> someone can say "You need to do X" and it's fixed. If more information is needed,
> I will send a copy of the stack (via private email) to anyone who asks.

I've used this method of including a file in a stack and it worked
fine under OS X, so I don't see why it doesn't work for you. However,
I have a few ideas.

- did you get the file into the CP using "file:" or "binfile:". Unless
it is plain text, use binfile.
- if the file contains binary text, answering it won't work.
- base64encode will tranform your binary data into plain text. It's
looks like garbage but it won't contains any weird characters. This is
how attachments are sent in emails - they are converted to straight
text and appended to the text of the email, then decoded at the other
end.
- presumably you want to save this file out so you can use it again.
Remember to save it using "binfile:" again to preserve any binary
data.

If none of these ideas help, feel free to send me a copy.

Cheers,
Sarah



More information about the use-livecode mailing list