Achilles Posted September 16, 2007 Share Posted September 16, 2007 (edited) I use a .au3 file on my desktop for trying lots of little scripts from here and there. Sometimes I end up adding more and more and eventually my desktop is crowded. This program basically lets you access one .au3 file from your tray. You can also start up the helpfile. expandcollapse popup#NoTrayIcon #Include <Constants.au3> #Include <File.au3> #include <Misc.au3> _Singleton('AutoItTray') Opt("TrayOnEventMode",1) Opt("TrayAutoPause",0) Opt("TrayMenuMode",1) $path = @TempDir & '\AutoItTray.au3' TrayCreateItem('Open') TrayItemSetState(-1, $TRAY_DEFAULT) TrayItemSetOnEvent(-1, '_Open') TrayCreateItem('Run') TrayItemSetOnEvent(-1, '_Run') TrayCreateItem('') TrayCreateItem('AutoIt Help...') TrayItemSetOnEvent(-1, '_Helpfile') TrayCreateItem('') TrayCreateItem('Exit') TrayItemSetOnEvent(-1, '_Exit') TraySetClick(8) TraySetIcon(@SystemDir & '\shell32.dll', -160) TraySetToolTip('AutoIt Tray') TraySetState() While 1 Sleep(200) WEnd Func _Open() If Not FileExists($path) then _FileCreate($path) EndIf ShellExecute($path, '', @TempDir, 'edit') TrayItemSetState(@TRAY_ID, $TRAY_DEFAULT) EndFunc Func _Helpfile() $temp = StringSplit(@AutoItExe, '\') ShellExecute(StringTrimRight(@AutoItExe,StringLen($temp[$temp[0]])) & '\AutoIt.chm') TrayItemSetState(@TRAY_ID, $TRAY_UNCHECKED) EndFunc Func _Run() Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $path & '"') TrayItemSetState(@TRAY_ID, $TRAY_UNCHECKED) EndFunc Func _Exit() Exit EndFunc Edited January 15, 2010 by Achilles My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
BillLuvsU Posted September 17, 2007 Share Posted September 17, 2007 guhhhhh, recursion = headache ; Good work though! [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 17, 2007 Share Posted September 17, 2007 I hit an awesome stack overflow error once because I accidentally created a recursive constructor. That was so hard to debug. Tray functions are always fun. Although, with your new function, why don't you just use a file save dialog instead of selecting a folder and using an inputbox? That just seems to me to make a little more sense. Link to comment Share on other sites More sharing options...
Achilles Posted September 18, 2007 Author Share Posted September 18, 2007 I hit an awesome stack overflow error once because I accidentally created a recursive constructor. That was so hard to debug.Tray functions are always fun. Although, with your new function, why don't you just use a file save dialog instead of selecting a folder and using an inputbox? That just seems to me to make a little more sense.Good idea... I knew there should be an easier way. Thanks, I'll update that sometime.@fear1313Thanks! This was the first time I used recursion... It was funny 'cause my AP Computer Science teacher couldn't think of a good example of how to use and I couldn't think how recursion would be useful... But this script showed me how useful it was! My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
BillLuvsU Posted September 18, 2007 Share Posted September 18, 2007 Ya, recursion is a pretty "specialized" technique. In fact I think the only time I've ever used it is in my example in the online autoit editor topic o_0. And thats pretty bad when your teacher can't come up with an example. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Achilles Posted September 18, 2007 Author Share Posted September 18, 2007 (edited) Ya, recursion is a pretty "specialized" technique. In fact I think the only time I've ever used it is in my example in the online autoit editor topic o_0. And thats pretty bad when your teacher can't come up with an example. My teacher rocks... I don't really blame him for not being able to think of a example of recursion of the top of his head, it doesn't seem to common. (Although I think Windows might use it to make their Start Menu) Plus it's independent study so a friend of mine and I are the only one in the class and he doesn't teach us, we just use the book.Updated version:Used FileSaveDialog() for the "New Script" functionAdded the option to recycle scripts Edited September 18, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
JustinReno Posted September 18, 2007 Share Posted September 18, 2007 I got to tell you, at first, i though it was kind of useless, but when I actually tried it, it was really good! And I'll probably use it to manage SWB when I'm editing it. Thanks for the neat script! l Link to comment Share on other sites More sharing options...
Achilles Posted September 18, 2007 Author Share Posted September 18, 2007 I got to tell you, at first, i though it was kind of useless, but when I actually tried it, it was really good! And I'll probably use it to manage SWB when I'm editing it. Thanks for the neat script!lYour welcome I use it (or will use it when I have time to use AutoIt more frequently) for helping people solve the problems they post on they post in help and support and the GUI support. It keeps my desktop cleaner! My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
JohnBailey Posted September 18, 2007 Share Posted September 18, 2007 I like it. In fact, this may save me time, specifically when wanting to test a script either I found online or I just thought of. Thanks! A decision is a powerful thing Link to comment Share on other sites More sharing options...
Nahuel Posted October 13, 2007 Share Posted October 13, 2007 Hey Piano Man! Loooooooving the "Quick Script" option! Hah, I'll use this every day. Thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2007 Moderators Share Posted October 13, 2007 If you have as many .au3 scripts as I do in a directory... this will definately throw a recursion error:Func _MakeTray($path, $menuID) $temp = _FileListToArray($path, '**', 2) For $index = 1 to UBound($temp) - 1 $tempIndex = TrayCreateMenu($temp[$index], $menuID) _MakeTray($path & '\' & $temp[$index], $tempIndex) Next Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Achilles Posted October 14, 2007 Author Share Posted October 14, 2007 (edited) I like it. In fact, this may save me time, specifically when wanting to test a script either I found online or I just thought of.Thanks!Your welcome! That's mostly what I use it for too...@NahuelHey Piano Man! Loooooooving the "Quick Script" option! Hah, I'll use this every day. Thanks smile.gifThanks!@SmOke_NIf you have as many .au3 scripts as I do in a directory... this will definately throw a recursion error:Any suggestions as to how change that? I was thinking limit each menu group to like 40 items and then tell the user that it has limited the amount of items. Edited October 14, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 14, 2007 Moderators Share Posted October 14, 2007 @SmOke_NAny suggestions as to how change that? I was thinking limit each menu group to like 40 items and then tell the user that it has limited the amount of items.Use one of the recursion _FileListToArray that randallc or myself made.Mine is _FileListToArrayEx() here in the example script forum.His is _FileListToArrayNew <<??? Not so sure, but I know it's in his signature.To be honest, I think his may be better though I've not had a need lately to need either one to test it.Anyway, you'll find them to faster in recursion mode, than yours probably is out of the box without recursion. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Achilles Posted January 13, 2009 Author Share Posted January 13, 2009 (edited) Updated. And completely remade. It only uses one file now. Double click the icon to ope the file in Scite. Edit: It also has a link to the helpfile... Edited January 13, 2009 by Ichigo My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Achilles Posted January 15, 2010 Author Share Posted January 15, 2010 Bug fixed if anyone cares. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
jaenster Posted January 15, 2010 Share Posted January 15, 2010 y i care about it Thanks i using it now in some apps that have a tray icon, in the most i disable the tray icon(#notrayicon). So eh.. thanks -jaenster 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