Sign in to follow this  
Followers 0
Minikori

Script not working properly

3 posts in this topic

#1 ·  Posted (edited)

Hello, I'm trying to write a script that will get the full window name of VLC Media Player and take out that part to get the current song's name and artist. But with this script I have, the current window's title becomes blank. The title of VLC is set up as "Artist - Song - VLC media player" Any help? Here's my code:

While 1
    $Title = WinGetTitle("VLC media player")
    $Song = StringTrimRight($Title, 19)
    WinSetTitle("[active]", "", $Song)
WEnd
Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ok, you want to trim the right side OFF the title

$Changed = False
$Title = "VLC media player" ; 16 not 19 here?

While 1
    If $Changed = False And WinActive($Title) Then
        $Title = WinGetTitle($Title)
        $Song = StringTrimRight($Title, 19) ; this will leave the "left" side of the text
        WinSetTitle($Title, "", $Song)
        $Changed = True
    EndIf
    Sleep(50)
WEnd

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

That script didn't work, and I'm not sure what that really would've done... And the reason for the 19 is because it's " - VLC media player" 19.


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

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  
Followers 0