#persistent #SingleInstance force CoordMode, Mouse, Screen CoordMode, ToolTip, Screen SetTimer, ToolTipDisplay , 250 ;update the tooltip in the text edit input box SW := A_Screenwidth ;position GUI in lower right corner SH := A_Screenheight ;position GUI in lower right corner GuiPosX := (SW-400) GuiPosY := (SH-250) selectfile: inputbox,file, Create a new TTP File?,Please input the name of the TTP file you would like to create`n`n the " .ttp" file extension will be automatically added.`n The file will be saved in the same directory as this utility. if errorlevel <> 0 ;error checking exitapp if file = exitapp Ifexist %file% ;check if file already exists { msgbox,4,Overwrite?,This file exists. would you like to overwrite it? IfMsgBox,Yes FileDelete,%file% IfMsgBox,No { gosub, selectfile exitapp } } ;GUI of TTP creator Gui, Add, text, ,Enter your custom text to appear in ToolTipPrompt Gui, Add, edit, r3 w330 xs vTTPtext, Gui, Add, text,,Press F11 to capture the current mouse position, relative to screen Gui, Add, text,xs,X Gui, Add, edit,x+5 w60 vMouseXpos number, Gui, Add, UpDown,Range1-2000 Gui, Add, text,x+25,Y Gui, Add, edit, w60 x+5 vMouseYpos number, Gui, Add, UpDown,Range1-2000 Gui, Add, button,w60 x+40 gAddClipboard,&Clipboard Gui, Add, button,w60 x+3 gNotepad,&Notepad Gui, Add, button,w250 xs gAddToolTip,&Append ToolTipPrompt to file Gui, Add, button,w80 x+3 gGuiClose,&Exit && Close Gui, +AlwaysOnTop gui, show,x%GuiPosX% y%GuiPosY%,%file%.ttp - %sw% x %sh% return f11:: ;hotkey to grab current mouse position MouseGetpos, MouseX, MouseY, Guicontrol,,MouseXpos,%MouseX% Guicontrol,,MouseYpos,%MouseY% return ToolTipDisplay: ;display the Text input box at the x y inpts Guicontrolget,MX,,MouseXpos Guicontrolget,MY,,MouseYpos Guicontrolget,TTPinputtext,,TTPtext Tooltip,%TTPinputtext%,%MX%,%MY% return AddToolTip: ;append tooltip to the file Guicontrolget,MX,,MouseXpos Guicontrolget,MY,,MouseYpos Guicontrolget,TTPinputtext,,TTPtext if MX= { msgbox, no X Position is entered in the prompt box return } if MY = { msgbox, no Y position is entered in the prompt box return } if TTPinputtext = { msgbox, no text is entered in the prompt box return } StringReplace, TTPinputtext, TTPinputtext, `n, ``n, All ;insert ``n linefeed for multi line fullmessage=%MX%,%MY%,%TTPinputtext%`n fileappend,%fullmessage%,%file%.ttp Guicontrol,,MouseXpos, ;clear input X box Guicontrol,,MouseYpos, ;clear input Y box Guicontrol,,TTPtext, ;clear input Text box tooltip, ;turn off tooltip return AddClipboard: ;add the text line to the clipboard Guicontrolget,MX,,MouseXpos Guicontrolget,MY,,MouseYpos Guicontrolget,TTPinputtext,,TTPtext if MX= ;error checking { msgbox, no X Position is entered in the prompt box return } if MY = ;error checking { msgbox, no Y position is entered in the prompt box return } if TTPinputtext = ;error checking { msgbox, no text is entered in the prompt box return } fullmessage=%MX%,%MY%,%TTPinputtext%`n clipboard=%fullmessage% return Notepad: ;open notepad with the current edit file Run, Notepad.exe %file%.ttp return GuiClose: ExitApp