#Persistent #SingleInstance force CoordMode, ToolTip, Screen Gui, Add, Text,,Select a ToolTipPrompt to use Gui, Add, ListView, r10 w250 gMyListView, Name ; Create the ListView with two columns, Name and Size: Gui, Add, Button,default w60 gMyListView, OK Loop, %A_ScriptDir%\*.ttp ; Gather a list of file names from a folder and put them into the ListView: LV_Add("", A_LoopFileName, A_LoopFileSizeKB) Gui, Show,,Select a Tool Tip File ; Display the window and return. The script will be notified whenever the user double clicks a row. return MyListView: RowNumber = 0 ; This causes the first loop iteration to start the search at the top of the list. Loop { RowNumber := LV_GetNext(RowNumber) ; Resume the search at the row after that found by the previous iteration. if not RowNumber ; The above returned zero, so there are no more selected rows. break LV_GetText(RowText, RowNumber) } if A_GuiEvent = DoubleClick ;Get file on Mouse double click { LV_GetText(RowText, A_EventInfo) ; Get the row's first-column text. } if RowText = { msgbox, You have not selected a TTP file. return } gui, destroy ;destrot the initial GUI Loop, Read, %A_ScriptDir%\%rowtext% Rowcount := A_Index ;how many lines are in the text file Line =1 SW := (A_Screenwidth-300) SH := (A_Screenheight-200) gui, add, button, w127 gPrev,&Prev gui, add, button, w127 x+3 gNext,&Next Gui, Add, Button, w50 xs gBlink,&Blink gui, add, button, w50 x+2 gHide,&Hide gui, add, button, w50 x+2 gDisplayToolTip,&Show gui, add, button, w50 x+2 gAll,&All gui, add, button, w50 x+2 gGuiClose,&Close gui add, text, w200 xs x70 vstatus, Gui, +AlwaysOnTop Gui, Color, FEFF8F gui, show, x%SW% y%SH%,ToolTipPrompt goto, DisplayToolTip Prev: ;line count - 1 Line -=1 goto, DisplayToolTip Next: ;line count + 1 Line +=1 goto, DisplayToolTip DisplayToolTip: ;display tooltip if Line > %Rowcount% ;error check if greater then lines { Msgbox, Thanks for using ToolTipPrompt. `n`nThis is the last tooltip`n`nUse Prev or Close. Line = %Rowcount% } if Line < 1 ;error check if less then 1 { msgbox, Thanks for using ToolTipPrompt. `n`nThis is the First tooltip Line = 1 } FileReadLine,linecontents,%RowText%,%line% Loop, Parse, linecontents,CSV { If A_Index = 1 ToolTipX =%a_loopfield% If A_Index = 2 ToolTipY =%a_loopfield% If A_index = 3 ToolTipText=%a_loopfield% If A_Index > 3 ;add extra indexes in text line -overcomes problem with comma's in text, thanks jgpaiva ToolTipText=%TooltipText%,%a_loopfield% } StringReplace, ToolTipText, ToolTipText, ``n, `n, All Tooltip,%tooltiptext%,%tooltipX%,%tooltipY% ;display tooltip at location X and Y GuiControl,, Status , ToolTipPrompt %Line% of %Rowcount% ;update GUI with steps return Blink: ;turn tooltip off for 250 and then back on. ToolTip Sleep,250 Tooltip,%tooltiptext%,%tooltipX%,%tooltipY% return Hide: ;turn off tooltip loop,%Rowcount% { ToolTip,,,,%A_Index% } return All: Loop, read, %A_ScriptDir%\%RowText% ;loop through the current selected file { Loop, parse, A_LoopReadLine, CSV ;parse the text line into X Y and TEXT { If A_Index = 1 ToolTipX =%a_loopfield% If A_Index = 2 ToolTipY =%a_loopfield% If A_index = 3 ToolTipText =%a_loopfield% If A_Index > 3 ToolTipText=%TooltipText%,%a_loopfield% } Tooltip,%tooltiptext%,%tooltipX%,%tooltipY%,%A_Index% ;display each tooltip with %A_Index% as the last parameter ie, 1 2 3 4etc } ;this will display up to 20 tooltips at once. return GuiClose: ;bye bye ExitApp