It is currently July 4th, 2024, 8:45 am

Running VBS script from button

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7636
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 17th, 2023, 1:02 pm Didn't work Trying again
Thanks, didn't try it, but looked through the code, it seems fine. Just curious though, all those Remote-Active-....ini are older and newer variants of the code or just stuff you load depending on the button pressed or the like? I liked the images / icons, very consistent design inspired from Stargate and adapted to a remote layout, and the code is of course adjusted to your specific objectives.

Where I would have proceeded differently (if I was you, which I'm not, as it's the author's prerogative) is trying to create less shorcuts / use less scripts and avoid writing to the registry, plus enclosing all bangs between square brackets just to be consistent all around. It's not that it isn't safe, or the code is faulty, it's just that generally, many of the actions there could have been replicated from within Rainmeter (yes, I know you're ATM more comfortable with scripts until you fully get the pulse of Rainmeter code, it's just a personal preference). Plus, if you're going to distribute it someday, users will be expecting such an approach and things to preferably happen with as few system adjustments as possible, in an environment they can easily control and adjust themselves via a code they already know how to handle. Obviously, as a personal skin is perfectly fine, since you know best how you'd prefer stuff to happen.

So, it's a special design and a special approach. Certainly very good for just starting out with skins! :thumbup:

P.S. Oh,and one other thing: you don't need to pack things into a .zip, Rainmeter has its own (also .zip based) skin packager that does the same thing with the added benefit of simply having to double click on the .rmskin file to install the skin in a "standard" fashion. In general, folks here resort to plain archives when a skin doesn't fit the 10 MB upload limit of an attachement on the forum, otherwise they go with the skin packager variant.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 17th, 2023, 4:25 pm Thanks, didn't try it,
Been relaxing hard all day.... As if, actually after dog spent day catching up on chores. Relaxed so hard thought I deserved a quick fix.

The Deactivate Activate works perfectly for my needs, Thank you for that.

Matter of interest how would I do the same thing in code without a button e.g.

"SOMETHINGHERE"=[!DeactivateConfig "Stargates\Remote-Idle" "Remote-Active-9.ini"] [!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-9.ini"]

And Remote-Active-9 Loads and opens up.

In answer to your question about all the files. NOPE, Every single one of those files is interactive with all the others and works and is needed, that's how a remote control with only 12 Action buttons buttons can control 144 different actions, load programs, websites whatever. More control functions by pressing at most two buttons than anyone is ever likely to need... Actually I think I got my maths wrong I'll check that tom I think it can currently control 192 different actions, and with a days work (which I def not going to do ATM) It could control over 750 different things. (With no extra buttons. Serious overkill.

Famous last words Like IBM with the original PC "640k of ram is ten times as much as anyone could ever possibly use".

Try it, it's fairly intuitive, only take two mins, put in Rainmeter as is, Load Little-Remote.ini (the only file in the stargate root folder). It may surprise you. And the graphics are cool and all original, Though the last buttons were rushed late at night, so I am going to re do them. It won't long and wont look much different, But when I saw them in the harsh light of day I thought, They were S#!T so after all this "FUN" (Dont want my head bitten of... LOL). I don't want to spoil the ship for a hapeth of tar.

I'll give all your wise words serious consideration tomorrow, I'm only having a quick play atm. But I would do the whole thing different now, for a start I discovered Include.... But too late it's too start over on this project (it was very much a learn how to do it exercise, that's gotten out of control). But I'm more than happy to make a few refinements or do some fine tuning, if it improves the finished project. But really I just want to finish this off now and then get on with something more exciting.

The Buttons spin like the ones on the Tablet in Night At the Museum.

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 17th, 2023, 4:25 pm
P.S. Oh,and one other thing: you don't need to pack things into a .zip, Rainmeter has its own (also .zip based) skin packager that does the same thing with the added benefit of simply having to double click on the .rmskin file to install the skin in a "standard" fashion. In general, folks here resort to plain archives when a skin doesn't fit the 10 MB upload limit of an attachement on the forum, otherwise they go with the skin packager variant.
Yes I knew that, but have not had chance to figure out how to use it, I started to look at it this morning then it started asking about layouts,wand I have not read anything about them yet, and I thought OH more learning (and this is a day off) so as it was just for you and I knew you would know what to do with i, so I just zipped it because I knew how to do that. :)

Keith

P.S. I would be very grateful if you found time to play with it for five mins, but I can imagine how busy you are. :lol:
User avatar
balala
Rainmeter Sage
Posts: 16379
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 16th, 2023, 9:20 pm I Tried using

LeftMouseUpAction=!ActivateConfig "Stargates\Childlock" "Childlock.ini" BUT it wont work, (Different directory, I assume). So have to use !ToggleConfig, Which works perfectly, no errors or warnings, BUT (AND HERE IS THE PROBLEM) I always have to click the button twice.

I would like to only click the button once.
If the LeftMouseUpAction=!ToggleConfig "Stargates\Childlock" "Childlock.ini" activates the skin (the path of the skin has to be Skins\Stargates\Childlock\Childlock.ini), the LeftMouseUpAction=!ActivateConfig "Stargates\Childlock" "Childlock.ini" option will also work. This is for sure, there is no doubt it will. What you have to take into account is the difference between the !ActivateConfig and the !ToggleConfig bangs: the first one (!ActivateConfig) activates the skin added as parameter, while the second one (!ToggleConfig) activates the skin if it's not activated and deactivates it if it's active. So if the skin is loaded, the !ActivateConfig bang does nothing. What I assume is that with the !ToggleConfig bang, you have to click twice to deactivate the skin (on the first click), then reactivate it (on the second click). But I'm not entirely sure what do you mean by !ActivateConfig doesn't work. Check the log when you use this bang, and see if there is any error message.
If you still can't get it working, please pack the whole config containing both the Childlock.ini skin and one which has an option to activate (or toggle) the Childlock.ini (for instance old Remote-Active-11.ini) and upload the package here, to can check.
LuciferVisuals wrote: April 16th, 2023, 9:48 pm I tried to delete this and send the correct one, but it didn't work.
You can delete an uploaded file, by clicking the Edit post button on the upper right corner of the field of your message:
Edit.png
When the editting tool opens, go down and click the Attachements tab:
Attachements.png
You get the list of the uploaded files. Click the Delete file button next to the file you want to remove (there is only one file I assume, so you have one single Delete file button, so it's most probably clear which button you have to click):
Delete.png
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7636
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 17th, 2023, 5:08 pmMatter of interest how would I do the same thing in code without a button e.g. "SOMETHINGHERE"=[!DeactivateConfig "Stargates\Remote-Idle" "Remote-Active-9.ini"] [!ActivateConfig "Stargates\Remote-Idle" "Remote-Active-9.ini"]
Depends on what you envision SOMETHINGHERE to be: on skin refresh, if a condition is met, if a string is matched, when a measure is updated, when a measure is changed, when a meter is updated, etc.
LuciferVisuals wrote: April 17th, 2023, 5:08 pmIn answer to your question about all the files. NOPE, Every single one of those files is interactive with all the others and works and is needed, that's how a remote control with only 12 Action buttons buttons can control 144 different actions, load programs, websites whatever.
Ah, I see. I don't know what remote you have, but for a TV Tuner remote there was a great program in the past called Promixis Girder, where one could make all kinds of scripts in Lua and similar to achieve a ton of functionality, similar to what you describe. I say in the past because it changed (and not for the better, IMHO) over the years and now it's not exactly what it used to be before, when you could search for a plugin for your specific remote (or even build one, if you were skillful) and use it with the program. I have to this day those scripts forgotten somewhere on my drives, but since in the meantime I changed both my TV Tuner from an internal Conexant 848/878 (if I recall correctly) to an AverMedia H830, my remote and gone from a desktop computer to a laptop as well, I kinda ceased to practice that "sport". But it was cool, I even made it to react to voice commands on various remote button press, and like you, multiplied the built in functionality of the remote greatly. Good days!
LuciferVisuals wrote: April 17th, 2023, 5:08 pmTry it, it's fairly intuitive, only take two mins, put in Rainmeter as is, Load Little-Remote.ini (the only file in the stargate root folder). It may surprise you.
I believe you, but I'll be honest and direct: I don't want shortcuts to be created on my desktop or anywhere, and I don't want to write stuff to the registry, unless of course I do it myself for my own specific reasons. Sure, I could just REM stuff I don't want in the .bat files or comment or whatever in .vbs files, but I have the feeling that it would reduce the skin functionality this way and my opinion on it would be unfairly influenced by that loss of functionality. Otherwise, I would try it without any problem, though i have my own suite myself which is quite complete.
LuciferVisuals wrote: April 17th, 2023, 5:08 pmBut I would do the whole thing different now, for a start I discovered Include....
Yeah, that's precisely why I asked you about those Remote-Active-....ini files, because I saw some parts there that were close to duplicates, and this can in some cases be avoided by writing a single time a code that's then used in @includes in all the skins you want to.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 17th, 2023, 6:14 pm Depends on what you envision SOMETHINGHERE to be: on skin refresh, if a condition is met, if a string is matched, when a measure is updated, when a measure is changed, when a meter is updated, etc.


I don't want shortcuts to be created on my desktop or anywhere, and I don't want to write stuff to the registry, unless of course I do it myself for my own specific reasons.
I forgot to delete them for the zip, NONE OF THAT IS IN USE, I did write code to put Icons on desktop. Works but also not in use, I gave up on the whole idea as far as this project was concerned. But as I say I may well come back to it in the future (OUT of Rainmeter), though My remote could trigger scripts IF YOU TELL IT TO and provide one. Then again it can do the same with anything you want the computer to do, given the same criteria.

I didn't want to throw it in the bin because there is some clever stuff in there. I WAS going to be use in this project, but I decided not to for the time being but kept them to come back to them later. You can delete the entire scripts folder this project does not use any of them. But I will still understand if you're too busy you must get so many request to look at stuff.

BTW This remote is only a VIRTUAL to control the computer functions via rainmeter (There is no RL version). It's like any other launcher, but a different approach (Well I think because I haven't looked at any others apart from the ones that came with Rainmeter.

It was intended to control a stargate for fun (hence the name) but soon went so far beyond that that the stargate got put on hold. .
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 17th, 2023, 6:14 pm
Sure, I could just REM stuff I don't want in the .bat files or comment or whatever in .vbs files,
Oh Delete Remote-active-A.ini. (IF I sent that because, that's also a left over), It might attempt to use scripts IF THEY WERE STILL THERE. Which they wont be if you delete the entire script folder, it wont effect anything current in my project.

I had forgot all about it till you mentioned the potential problem. None of my current code uses those, so you would have to load them manually and even Remote-Active-A.ini then cannot use a script, if you have simply deleted the entire script directory.

This was some of the first stuff I wrote, and because it worked I have been reluctant to delete it and throw it away.

But I long since realised it wasn't needed in Rainmeter, (though ironically) I think that was why we first spoke.


So in short delet the Scripts folder, it does not do anything anymore

K
User avatar
Yincognito
Rainmeter Sage
Posts: 7636
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 17th, 2023, 6:36 pmI forgot to delete them for the zip, NONE OF THAT IS IN USE, I did write code to put Icons on desktop.
Ah, ok, didn't know that, good. Ok then, I'll give it a try later on - either tonight or tomorrow, will see (I sort of approach my relax time today, so the whole thing is based on my mood, lol). I'll share my impression after I do.
LuciferVisuals wrote: April 17th, 2023, 6:36 pmthough My remote could trigger scripts IF YOU TELL IT TO and provide one
Yep, that's the way to go: give the user the chance to choose in these cases (i.e. the ones that involve changes to his system). Or, use a "dialog skin / meter" of some sort to ask him if he "really" wants to make such modifications - whatever feels more comfortable from a coding point of view. Personally, I have no problem with modifications per se (I've done lots and way riskier myself), I only have problems with modifications against my will or without me knowing, and this is quite normal. But now that you said they can be avoided if desired, it's all good.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7636
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Running VBS script from button

Post by Yincognito »

balala wrote: April 17th, 2023, 5:58 pm If the LeftMouseUpAction=!ToggleConfig "Stargates\Childlock" "Childlock.ini" activates the skin (the path of the skin has to be Skins\Stargates\Childlock\Childlock.ini), the LeftMouseUpAction=!ActivateConfig "Stargates\Childlock" "Childlock.ini" option will also work. [...]
Sorry balala, with all the industrious discussion here, didn't get the chance to see your reply, but you're entirely correct, of course. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

balala wrote: April 17th, 2023, 5:58 pm
Delete.png
Hi Im so sorry I Missed your post, TBH I'm still also working out how a forum works.

I'm having a day off this today, (or trying to LOL....) So I will take a good look at everything tom.

I did get involved with another ongoing conversation, but that was not really about any specific issue just chatting really, though as the thing we have in common is Rainmeter and My skin obviously it was always around the subject.

It was rude of my not to respond, but for some reason that I don't understand, All the other post I get all come up with that bell notification (Top Right), basically telling me there is a post to look at, this one didn't for some reason (or perhaps it did and I missed it). It was only when the other "Sage" apologised for not acknowledging your post that I became aware of it.

It was not intentional. I'm trying to do nothing with this today, other than keeping in touch when required, I needed a break, I was overthinking everything, It's a lot to take in, and there is so much more, I haven't scratched the surface. You all did it so long ago, you probably only vaguely remember, how rigorous the learning curve is for a newbie.

Sorry again, no slight intended.


Keith