import text file. WAS empty :-)

Klaus Major klaus at major-k.de
Thu May 26 06:43:54 EDT 2005


Hi Brad,

> This is probably something obviouse. Here's the script:

Not too obvious, actually :-)

> answer file "Please select a file."
> put there is a file it
> put URL it into field "Entities"
>
> The second line outputs true. The third line just places the path  
> into the
> field, not the file's contents (it's just a text file I'm trying to
> import). I get exactly the same results if I remove the URL from the
> statement. I've tried adding 'put "field:" & it...

Script this, the addition "file:" is needed here with the URL keyword:

answer file "Please select a file."
put there is a file it
put URL("file:" & it) into field "Entities"

Will import that textfile into your field.

Hint: The brackets are very important if you are "constructing" a  
"string"
like here in this example!

> OS 10.3.9, RR 2.5.1
>
> Brad

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list