Save field text to file
m.schonewille at economy-x-talk.com
Sun Dec 10 11:16:13 EST 2006
The script should look like:
ask file empty with "Untitled.txt"
-- now, the variable 'it' contains a file path or
-- it is empty if the user pressed Cancel
if it is not empty then
put it into myFile
-- set filetype before creating a file
set the filetype to "ttxtTEXT"
put fld "edtText" into url ("file:" & myFile)
Don't forget: thou shalt always use quotes around literals! The name
edtText should be surrounded by quotes.
Consultancy and Software Engineering
Get your store on-line within minutes with Salery Web Store software.
Download at http://www.salery.biz
Op 10-dec-2006, om 16:16 heeft Adrian Williams het volgende geschreven:
> Thanks for that. Logical really. Just shows my newness to Rev!
> Your suggestion about filetype saves the text out to a file,
> but the file is Saved with the filename tFilePath. What's wrong
> with my code that "Untitled.txt" is not used?
> case "Save"
> ask file empty with "Untitled.txt"
> put URL tURLfile into URL ("file:" & tFilePath)
> set the filetype to "ttxtTEXT"
> put fld edtText into url ("file:" & tFilePath)
> Many thanks,
More information about the Use-livecode