Jump to content

Tooltip when a Window Title changes


Recommended Posts

Hello..

i'm working in a script witch i am making for spotify...

and i wanted to make a tooltip for each new song that comes on, witch shows what song it is..

the song is written in the Window tiltle and in the top colum on the trayiconitem... i dont know if it is possible to read anything from another trayicon's items.. but there is the Window title witch says "Spotify - Artist - Song", and if there was any way to read that and some way remove the "Spotify -" ??

and how can i make the tooltip change when the Window title changes (new song) ?

:D

Link to comment
Share on other sites

ok, i figured how i get the title

WinGetTitle ("Spotify -", "")

But how can i just get the part that comes after "Spotify -" ... and how do i make it sett a new tooltip when the title changes? :D

Link to comment
Share on other sites

ok, i figured how i get the title

WinGetTitle ("Spotify -", "")

But how can i just get the part that comes after "Spotify -"

StringSplit ?

and how do i make it sett a new tooltip when the title changes? :D

Tooltip() Edited by oMBRa
Link to comment
Share on other sites

StringSplit ?

Tooltip()

cant get the stringsplit to work, (i've tried to search, but i could not figure out hot it works :D )

this was the closest i got

$title = stringsplit (wingettitle ("Spotify -"),"spotify -")
MsgBox(0, "Title read was:", $title)

and "Tooltip()"??

with a func is ok, but how can i make it show the new tooltip when the song changes (WindowsTiltle Changes)

Edited by Vegar
Link to comment
Share on other sites

How about this....does this help?

$title=WinGetTitle("","")

$location=StringInStr($title,"-",0,1)

$length = StringLen($title)-$location

$rightside = Stringright($location,$length)

ToolTip($rightside)

sleep(10000)

ToolTip("")

Link to comment
Share on other sites

$title = WinGetTitle ("Spotify -")
$location = StringMid ($title, 10)
ToolTip ($location)

while 1

if not $title=WinGetTitle ("Spotify -") then 
$title = WinGetTitle ("Spotify -")
$location = StringMid ($title, 10)
ToolTip ($location)
endif
sleep(100)
wend

Edited by picea892
Link to comment
Share on other sites

$title = WinGetTitle ("Spotify -")
$location = StringMid ($title, 10)
ToolTip ($location)

while 1

if not $title=WinGetTitle ("Spotify -") then 
$title = WinGetTitle ("Spotify -")
$location = StringMid ($title, 10)
ToolTip ($location)
endif
sleep(100)
wend

This did not work :-/

Link to comment
Share on other sites

  • 7 months later...

Global $ArtistOgTitle = "-", $OldArtistOgTittel = ""

While 1

$var = winlist()

for $i = 1 to $var[0][0]

if stringleft($var[$i][0], 7) = "spotify" then

If $var[$i][0] <> "Spotify" Then

$OldArtistOgTittel = $ArtistOgTitle

$ArtistOgTitle = StringReplace($var[$i][0], "Spotify - ", "")

If $OldArtistOgTittel <> $ArtistOgTitle Then

Tooltip(" " & $ArtistOgTitle & " ", 20,10)

EndIf

EndIf

Sleep (30)

exitloop

endif

next

Sleep (250)

Wend

Exit

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...