rawrr Posted February 25, 2008 Share Posted February 25, 2008 Hello. I have made a tray menu, that changes text in a file when you click on a tray "item" I want to make it so a tray "item" says add and when you click it.. It brings up with textbox, where you type in what you want to save, then type name.. and save.. and then it stays there forever.. How would I do this? Link to comment Share on other sites More sharing options...
Achilles Posted February 25, 2008 Share Posted February 25, 2008 Would you mind posting what you have? So far so that we can add on instead of just scripting this whole thing for your.. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
rawrr Posted February 25, 2008 Author Share Posted February 25, 2008 (edited) #Include <Constants.au3> #NoTrayIcon Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $google = TrayCreateItem("google") traycreateitem("") $exit = traycreateitem("Exit") TraySetState() ; Check if file opened for writing OK While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop case $msg = $google $f1 = FileOpen("C:\sites.txt", 2) If $f1 = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($f1, "www.google.com") Case $msg = $Exit ExitLoop EndSelect WEnd Exit Edited February 25, 2008 by rawrr Link to comment Share on other sites More sharing options...
rawrr Posted February 25, 2008 Author Share Posted February 25, 2008 Anyone?? =[ Link to comment Share on other sites More sharing options...
rawrr Posted February 26, 2008 Author Share Posted February 26, 2008 Bump. =[ please guys, somebody has to know. Link to comment Share on other sites More sharing options...
Pimmetje Posted February 29, 2008 Share Posted February 29, 2008 I made something for you i hope it is what you are looking for #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.10.0 Author: Pimmetje Date 29 - 02 - 2008 Script Function: Write some input text into a file open from de sys tray #ce ---------------------------------------------------------------------------- Opt("TrayMenuMode",1) $addnewline = TrayCreateItem("add new line") $exit = TrayCreateItem("Exit") While 1 $msg = TrayGetMsg() Select Case $msg = $exit ExitLoop case $msg = $addnewline addtofile(InputBox ( "Add a new line", "What do you want to add to the file?" )) EndSelect WEnd Func addToFile($line) ; Check if file opened for writing OK $file = FileOpen("test.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Need @CR And @LF else windows don't get the new line FileWrite($file, @CR&@LF& $line) FileClose($file) EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now