Jump to content
Sign in to follow this  
Vegar

Tooltip when a Window Title changes

Recommended Posts

Vegar

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

Share this post


Link to post
Share on other sites
Vegar

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

Share this post


Link to post
Share on other sites
Vegar

:D help plz (i'm kinda noob)

example? :D

Share this post


Link to post
Share on other sites
oMBRa

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

Share this post


Link to post
Share on other sites
Vegar

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

Share this post


Link to post
Share on other sites
picea892

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("")

Share this post


Link to post
Share on other sites
Vegar

Nice, Got it :D

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

Share this post


Link to post
Share on other sites
Vegar

But now i need to know how i make it show a new tooltip for each time the tiltle changes (new song)

ive tried som "if" funcions, but did not quite get that to work.. how can i do this? :D

Share this post


Link to post
Share on other sites
picea892

$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

Share this post


Link to post
Share on other sites
Vegar

$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 :-/

Share this post


Link to post
Share on other sites
frme

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

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  

×