Jump to content
Sign in to follow this  
Hello Me You

TrayCreateItem

Recommended Posts

Hello Me You

Is it possible to create a tray item that allows you to edit the script?


Random

Share this post


Link to post
Share on other sites
lod3n

What a useful idea. Here you go. Note that this will not work on compiled scripts, for obvious reasons.

#Include <Constants.au3>
#NoTrayIcon

Opt("TrayMenuMode",1)   ; Default tray menu items (Script Paused/Exit) will not be shown.

$edititem  = TrayCreateItem("Edit Script")
TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $edititem
            _EditSelf()
    EndSelect
WEnd

Exit


func _EditSelf()
    local $objShell = ObjCreate("Shell.Application")
    local $objFolder = $objShell.Namespace(@ScriptDir)
    local $objFolderItem = $objFolder.ParseName(@ScriptName)
    $objFolderItem.InvokeVerb("Edit")
    Exit
EndFunc

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites
Hello Me You

Thanks man, works great but when I click edit script (after the editor opens and shows the script) the script exit.


Random

Share this post


Link to post
Share on other sites
Helge

Thanks man, works great but when I click edit script (after the editor opens and shows the script) the script exit.

You don't think that has something to do with the Exit in the end of _EditSelf ?

Anyway, isn't that _EditSelf the same as... this ?

ShellExecute(@ScriptFullPath, "edit")

Share this post


Link to post
Share on other sites
Hello Me You

Oops sorry, I didn't see the Exit at the end :whistle:


Random

Share this post


Link to post
Share on other sites
lod3n

AutoIt's ShellExecute and I have a bad relationship. We aren't speaking to each other.

Try this:

ShellExecute(@ScriptFullPath, "properties")
sleep(2000)oÝ÷ Ø]¡ë'ßÛp¢¹éí¯(­¾&­çZ®K"u殶­sbb33c¶ö&¥6VÆÂÒö&¤7&VFRgV÷Cµ6VÆÂäÆ6FöâgV÷C²¢b33c¶ö&¤föÆFW"Òb33c¶ö&¥6VÆÂäæÖW76R67&DF"¢b33c¶ö&¤föÆFW$FVÒÒb33c¶ö&¤föÆFW"å'6TæÖR67&DæÖR¢b33c¶ö&¤föÆFW$FVÒäçfö¶UfW&"gV÷C·&÷W'FW2gV÷C²§6ÆVW#oÝ÷ Ù'1¬xýë"­Âº'»­"­zÈ­r©j·¶¬x,h¥j·îËb¢v¥Ü¢éÝvéeeÆ­èn7´èZܨ¹Æ§+-¢ëmæ¯j)ZnW¯z¶ì¶¯+ajÜ"¶¡zYDÅç.µæ®¶­sbb33c¶6öÅfW&'2Òb33c¶ö&¤föÆFW$FVÒåfW&'0¤f÷"b33c¶ö&¥fW&"âb33c¶6öÅfW&'0¢6öç6öÆUw&FRb33c¶ö&¥fW&"ääÔRfײ5$Äb¤æW

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.