Page 1 of 1

Help me find the right code?

Posted: Tue Sep 22, 2009 11:17 pm
by freddu1
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

Posted: Tue Sep 22, 2009 11:58 pm
by bn
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

Posted: Wed Sep 23, 2009 3:19 am
by freddu1
awesome! you guys make the forums a great place 8D