save text in field as

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

save text in field as

Post by reelstuff » Fri Apr 04, 2008 2:42 pm

I was looking over the new docs looking for a way to save text from a field,

the new 2.9 docs are much better, thanks to the Rev Gods,

however, I was looking for an example of how to save the text I have in a field.

Code: Select all

 ask file "Save this document as:" with "Re_name_me.js"
which works as it should, I got a little lost when thinking about connecting the ask file and the actual text from the field that I wanted to save to the file,

So I am thinking that I need to put the text into a variable or perhaps,

Code: Select all

put the text of field final_var into me
/then I would need to find a way to get the data to save into a
/file so the user can select the location to save the data into
I still feel a little dense sometimes, but I certainly appreciate the help.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Fri Apr 04, 2008 3:17 pm

Hi.

The result of the ask dialog will be placed in the it helpervariable.

Code: Select all

ask file "where"
put the text of fld "myField" into URL ("file:"&it)
should do the trick. If you want to get more sophisticoted, check if it is empty first. (This would mean your user hit the cancel button)

Hope that helps,

Malte

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Contact:

Post by reelstuff » Fri Apr 04, 2008 3:24 pm

malte wrote:Hi.

The result of the ask dialog will be placed in the it helpervariable.

Code: Select all

ask file "where"
put the text of fld "myField" into URL ("file:"&it)
should do the trick. If you want to get more sophisticoted, check if it is empty first. (This would mean your user hit the cancel button)

Hope that helps,

Malte
Thank you yes, that works great, that helps in some other questions I had as well,

Post Reply