Old 27th July 2003, 19:41   #1
Nimelennar
Major Dude
 
Nimelennar's Avatar
 
Join Date: Mar 2003
Location: Canada
Posts: 841
Send a message via ICQ to Nimelennar
Request: Minimize on startup script

I use Winamp mostly as a background player, using things like the Winkey-J component from Yonido and RM-X to control it almost entirely from the keyboard while it sits minimized in the tray.

I've asked about a script on minimizing Winamp to the tray on startup elsewhere, and I was given a set of instructions that I could not understand (being unfamiliar with scripting) and I'd really rather not learn how to script when I'd only use my ability to script in order to do one thing.

I was wondering if someone could take a few minutes out of their time to code this script up for me and give me some idea how to integrate it into Winamp.

Here are the instructions that I was given on how to do it:
Quote:
Originally posted by lunarboy1
In a script get the minimize button of the main window and call leftClick() on the minimize button in the System.onScriptLoaded()func. That should do it.
Thanks a lot in advance!

The world is made of conflicts: good and evil, order and chaos, light and dark, hot and cold. All are essential to life. None can prevail for any length of time, or life will fail. In the end, the best any can hope for is balance.
Nimelennar is offline   Reply With Quote
Old 27th July 2003, 20:09   #2
hammerhead
The Shark
(Forum King)
 
hammerhead's Avatar
 
Join Date: Jul 2002
Posts: 2,537
Send a message via AIM to hammerhead
I'm going to assume you are familiar with XML.

First, you'll need to define a button in your XML that minimizes, it needs no form nor image.

code:
<button
id="minimize"
action="minimize"
/>



Then, compile the following script and add it to your scripts directory.

PHP Code:
#include "../../../lib/std.mi"

Global Button buttonMinimize;

system.onScriptLoaded(){
group buttonGroup getScriptGroup();
buttonMinimize buttonGroup.getObject("minimize");
buttonMinimize.leftClick();

Now add the script tag to your XML:

code:
<script id="minimizeonstartup" file="min.maki" />


Hope this helps!
hammerhead is offline   Reply With Quote
Old 27th July 2003, 20:22   #3
Nimelennar
Major Dude
 
Nimelennar's Avatar
 
Join Date: Mar 2003
Location: Canada
Posts: 841
Send a message via ICQ to Nimelennar
uggh... /me doesn't know XML.

The world is made of conflicts: good and evil, order and chaos, light and dark, hot and cold. All are essential to life. None can prevail for any length of time, or life will fail. In the end, the best any can hope for is balance.
Nimelennar is offline   Reply With Quote
Old 28th July 2003, 09:57   #4
J_Bloggs
Major Dude
 
J_Bloggs's Avatar
 
Join Date: Jan 2002
Posts: 1,778
Ok, I'm not sure wether this will work or not, doesn't quite work for me but WA3 doesn't, so I use WA2 so eh.

Anyway, unzip it to <your winamp3 folder, wherever that is [default C:\program files\winamp3]>\addons\minimize, add it as an add-on to winamp 3, and well, see if it works.

Or, if you use a shortcut to open winamp, try setting the 'run' option to minimized. That would be a lot simpilar/garenteed. (if you prefer hotkeys, you can asign a hotkey to a shortcut [from the shortcuts own properties no less], and still have minimized as the run option, this would probably be the best option)
Attached Files
File Type: zip minimize.zip (1.9 KB, 91 views)

¯¯¯¯Joe Bloggs____
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J_Bloggs is offline   Reply With Quote
Old 29th July 2003, 17:44   #5
Nimelennar
Major Dude
 
Nimelennar's Avatar
 
Join Date: Mar 2003
Location: Canada
Posts: 841
Send a message via ICQ to Nimelennar
Quote:
Originally posted by J_Bloggs
Ok, I'm not sure wether this will work or not, doesn't quite work for me but WA3 doesn't, so I use WA2 so eh.

Anyway, unzip it to <your winamp3 folder, wherever that is [default C:\program files\winamp3]>\addons\minimize, add it as an add-on to winamp 3, and well, see if it works.
It doesn't work, but thanks. It gives the following error: "Error while loading a script, a component is missing". I'll see if I can take a look at the code and try to figure out how it's supposed to work.

Quote:
Originally posted by J_Bloggs
Or, if you use a shortcut to open winamp, try setting the 'run' option to minimized. That would be a lot simpilar/garenteed. (if you prefer hotkeys, you can asign a hotkey to a shortcut [from the shortcuts own properties no less], and still have minimized as the run option, this would probably be the best option)
That was the first thing I tried. (Well, the second... the first was to search through the Winamp program itself.) Apparently it doesn't recognise the command. I guess that's a bug...

Thanks for the script and the suggestions!

The world is made of conflicts: good and evil, order and chaos, light and dark, hot and cold. All are essential to life. None can prevail for any length of time, or life will fail. In the end, the best any can hope for is balance.
Nimelennar is offline   Reply With Quote
Old 6th August 2003, 03:16   #6
Nimelennar
Major Dude
 
Nimelennar's Avatar
 
Join Date: Mar 2003
Location: Canada
Posts: 841
Send a message via ICQ to Nimelennar
OK, I finally took a look at the code, and I couldn't make heads or tails of it, so can someone please fix the script above so that it works (or make a new one that does work)? Thanks.

The world is made of conflicts: good and evil, order and chaos, light and dark, hot and cold. All are essential to life. None can prevail for any length of time, or life will fail. In the end, the best any can hope for is balance.
Nimelennar is offline   Reply With Quote
Old 18th September 2003, 22:26   #7
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
Hey Nimelennar, I got your PM but thought I'd post the script here for future posterity. Use this script as an add-on, extracted into your "C:\Program Files\Winamp3\Addons" folder (or wherever it is on your system). All I really did was modify Bloggs's script which contained a minor syntax error.

Also, triggering the minimize action during the onScriptLoaded event wasn't very reliable for some reason, sometimes it failed, so I set the minimize action on a short delay which seemed to do the trick. Side effect though is that you might see the window for a second before it minizes.

Good luck and let me know if you have any problems!
Attached Files
File Type: zip minimizeonstartup.zip (2.1 KB, 112 views)
rpeterclark is offline   Reply With Quote
Old 18th September 2003, 22:34   #8
Nimelennar
Major Dude
 
Nimelennar's Avatar
 
Join Date: Mar 2003
Location: Canada
Posts: 841
Send a message via ICQ to Nimelennar
Thanks a lot. It crashed Winamp the first couple of times I tried it, but it worked fine after that. And the window flashing open for a second doesn't bother me at all.
Thanks again!

The world is made of conflicts: good and evil, order and chaos, light and dark, hot and cold. All are essential to life. None can prevail for any length of time, or life will fail. In the end, the best any can hope for is balance.
Nimelennar is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump