Help me find the right code?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
freddu1
Posts: 4
Joined: Tue Sep 22, 2009 11:11 pm

Help me find the right code?

Post by freddu1 » Tue Sep 22, 2009 11:17 pm

I just came up with this idea as an app... you have a text field, and a save button... when you type something in the field and click save, it saves it to a txt file on your desktop

any ideas? thanks

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Tue Sep 22, 2009 11:58 pm

Hi Freddu1,

Welcome to the forum.

put this script into a save button

Code: Select all

on mouseUp
   put specialfolderpath("desktop") & "/" into tPathToMyDeskTop
   put tPathToMyDeskTop & "mySavedField.txt" into tPathToMyFile
   put "file:" & tPathToMyFile into tURL
   
   put field 1 into tMyText
   if tMyText is not empty then
      put tMyText into URL tURL
      answer "Your Text is saved to the desktop"
   else 
      answer "Nothing in the field to save"
   end if
end mouseUp
You might want to look up URL in the dictionary, also specialfolderpath.
This should get you started
regards
Bernd

freddu1
Posts: 4
Joined: Tue Sep 22, 2009 11:11 pm

Post by freddu1 » Wed Sep 23, 2009 3:19 am

awesome! you guys make the forums a great place 8D

Post Reply