It is currently July 4th, 2024, 10:21 am

Running VBS script from button

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16380
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 17th, 2023, 8:03 pm It was rude of my not to respond,
Don't worry, it was not. But I'm still stopped on the point where you couldn't get the !ActivateConfig bang working, but could the !ToggleConfig bang. It's still curious to me this did happen. If the issue has not been fixed by Yincognito, and you are still curious, you should have to pack the config and upload the package, containing both skins, Childlock.ini and the one which has the option to activate (or toggle) the Childlock.ini (for instance old Remote-Active-11.ini), as well as the needed resources (practically the whole @Resources folder). If you don't know how to do this, please let me know, for guidance.
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, 8:16 pm Don't worry, it was not. But I'm still stopped on the point where you couldn't get the !ActivateConfig bang working, but could the !ToggleConfig bang. It's still curious to me this did happen. If the issue has not been fixed by Yincognito, and you are still curious, you should have to pack the config and upload the package, containing both skins, Childlock.ini and the one which has the option to activate (or toggle) the Childlock.ini (for instance old Remote-Active-11.ini), as well as the needed resources (practically the whole @Resources folder). If you don't know how to do this, please let me know, for guidance.
Hi this is a zip of my project.

See what you think, I think I fixed the childlock.ini loading issue, But dont want to think about it today. Really need a break will start fresh tom.

Keith

Not worked out how to use rmskin yet. the only stuff in my root is little-remote.ini, and three folders as zipped. the little-remote.ini is the startup point.
You do not have the required permissions to view the files attached to this post.
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 plus enclosing all bangs between square brackets
I just had a quick look at my code and see what you mean about the square brackets, Basically having not read the manual, as and when I had a problem I looked at peoples post for similar issues. Some did people used them some didn't, so I thought that sometimes they were needed sometimes not. (Go on laugh)...... :lol: So if the bit of code didn't have them in the first place, it never occurred to me to add them, though more recently I have been.

Thanks to Notepad++ global find and replace it' shouldn't take long to put them around everything, Now I have found how to use that programs more advanced features it will save me hours of work, in fact already has. The Remote I made was originally single sided, it is now double sided, you can turn it over and thus double it's capacity, the entire other side was knocked out in under a day, thanks to this feature. That's why the last buttons are of less quality than the earlier ones, because I had to knock them out quickly at the end of a long day, (So that the new side had buttons to use). But they are on my list to do again better.

If I had discovered Rainmeters the ability to tint an image I could of used the same buttons for both sides, but tinted (I tinted the reverse of the remote anyway, to make it darker, as a visual reminder of which side of the remote you are using). But by the time I found out about that I had already revised all the code on the assumption I needed new buttons. So was not inclined to change it back again especially as I had made them.

I also thought the dark side could launch events a user might prefer not to have immediately accessible from the light side...... Porn as an obvious example, but could also be access to a work computer system. Hence the last question about activating the lock from code. I Thought I might incorporate a revised version of the child lock with a different password on the turn to the dark side button. So the "Wife"or Boss couldn't turn the remote over to the dark side... Lol.

Keith
User avatar
balala
Rainmeter Sage
Posts: 16380
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 17th, 2023, 8:50 pm Hi this is a zip of my project.
Looking a bit to your project, here are some details I see and I'd modify:
  • The [LockButton] meter of the Remote-Idle\Remote-Active-1.ini skin activates properly the Childlock\Childlock.ini skin, using the !ActivateConfig bang. So, am not entirely sure what didn't work. Same way, tried on Remote-Idle\Remote-Active-2.ini and does work as well. Even if didn't try all of those skins, I assume all of them are working. So, not sure...
  • There is no meter on none of skins, using the !ToggleConfig bang, instead of !ActivateConfig, even if you said you finally had to use this bang.
  • Unlike !ActivateConfig or !ToggleConfig, the !DeactivateConfig bang requires one single parameter, the name of the config. The name of the skin is not needed, because if there is a skin activated and you want to deactivate it with the !DeactivateConfig bang, Rainmeter knows which skin of the config is active and can deactivate it even without telling it which one to deactivate. This is why in the [!DeactivateConfig "Stargates\Childlock" "Childlock.ini"] bang, the above red marked "Childlock.ini" parameter can be removed. If you leave it on the bang, the bang still work, as you saw, but this is happening only because the !DeactivateConfig bang ignores all parameters, excepting the first one. So it ignores the name of the skin. But strictly speaking, the name of the skin is not needed.
  • When you're setting a color (or any other parameter) of a meter using a !SetOption bang, there is no need to update all meters. Can be done and in fact affects nothing, but simply doesn't worth. For instance in MouseOverAction and MouseLeaveAction options of the [LockButton] meters of all skins, you've used two !SetOption bangs to set the font color and text of the [MeterString-Footer-XX] meter, using two !SetOption bangs. Then you've updated all meters, by the [!UpdateMeter *] bang. Why to update all of them, if only one single has been altered? I'd replace the [!UpdateMeter *] bangs with [!UpdateMeter "MeterString-Footer-2"], to get update only the needed meter:

    Code: Select all

    [LockButton]
    ...
    MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "LOCK COMPUTER"][!UpdateMeter "MeterString-Footer-2"][!Redraw]
    MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter "MeterString-Footer-2"][!Redraw]
    ...
    Same applies to all meters of all those skins.
User avatar
Yincognito
Rainmeter Sage
Posts: 7638
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 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.
As promised, I did try it today (after moving the Scripts folder somewhere else just in case), and your were right: I am positively surprised. Balala already mentioned some technical details, but in terms of experience and amount of possible functions that can be added, it's very good. It's like a menu opening other submenus in the same space, quite similar to the launcher skin in my suite in that regard (good solution to keep things compact and consistent in design). Obviously, the images are very nice as I already said, and the buttons and their variations as well.

You're correct, tinting images (and optionally resizing them at the same time via the ActionTimer plugin) is a cool way to "activate" buttons on hover, click or even both:
ezgif.com-video-to-gif.gif
Anyway, I liked it, nice work! :thumbup:
You do not have the required permissions to view the files attached to this post.
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 18th, 2023, 12:47 pm As promised, I did try it today
Thank, today put brackets round all bangs. Uses Notepad++ global find and replace, Amazing got every single one in one pass... there was not one it failed to find and ~u£% Up!!!

Luckily I anticipated the possibility and backed it all up first, but had to do over in smaller bits, testing each time, but done now and looks neater. been also revised and improved all the comments, they were crystal clear to me but I didn't really need them.. They were prob not so clear to someone seeing it for the first time, they are much better now.

Today I realised a Help Screen would be a good idea so I have been adding one, still a work in progress but the code to open and close it is not working "Perfectly" IT Opens it Ok, And it closes it OK (perfectly in fact. BUT THEN IT DOES NOT WORKS A SECOND TIME, I suspect that [!Deactiveat etc}

Can you see at a glance what's wrong, I have pasted it below.

Code: Select all

[HideHelp]
Meter=Button
ButtonImage=#@#Buttons\HideHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Hide Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
Buttoncommand=[!RainmeterShowMeter HideHelp][!RainmeterHideMeter ShowHelp][!DeactivateConfig "Stargates\Remote-Help" "Remote-Help.ini"]
Hidden=1

[ShowHelp]
Meter=Button
ButtonImage=#@#Buttons\ShowHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Show Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
Buttoncommand=[!RainmeterShowMeter HideHelp][!RainmeterHideMeter ShowHelp] [!ActivateConfig "Stargates\Remote-Help" "Remote-Help.ini"]

Have to rush, still coding it and want to get back before I forget what I'm doing.

ALSO, I have a post from Balala to answer, haven't seen it yet. So I'm going to ask him the same question, not because I doubt either of you but simply because I don't want him to thing I'm blowing him out, but let me know for next time whether asking two Sages the same question is a no no.

Keith
Last edited by balala on April 18th, 2023, 4:12 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

balala wrote: April 18th, 2023, 6:30 am Looking a bit to your project, There is no meter on none of skins, using the !ToggleConfig bang,

instead of !ActivateConfig, even if you said you finally had to use this bang.
[*]Unlike !ActivateConfig or !ToggleConfig, the !DeactivateConfig bang requires one single parameter, the name of the config. The name of the skin is not needed, because if there is a skin activated and you want to deactivate it with the !DeactivateConfig bang, Rainmeter knows which skin of the config is active and can deactivate it even without telling it which one to deactivate. This is why in the [!DeactivateConfig "Stargates\Childlock" "Childlock.ini"] bang, the above red marked "Childlock.ini" parameter can be removed. If you leave it on the bang, the bang still work, as you saw, but this is happening only because the !DeactivateConfig bang ignores all parameters, excepting the first one. So it ignores the name of the skin. But strictly speaking, the name of the skin is not needed.
[*]When you're setting a color (or any other parameter) of a meter using a !SetOption bang, there is no need to update all meters. Can be done and in fact affects nothing, but simply doesn't worth. For instance in MouseOverAction and MouseLeaveAction options of the [LockButton] meters of all skins, you've used two !SetOption bangs to set the font color and text of the [MeterString-Footer-XX] meter, using two !SetOption bangs. Then you've updated all meters, by the [!UpdateMeter *] bang. Why to update all of them, if only one single has been altered? I'd replace the [!UpdateMeter *] bangs with [!UpdateMeter "MeterString-Footer-2"], to get update only the needed meter:

Code: Select all

[LockButton]
...
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "LOCK COMPUTER"][!UpdateMeter "MeterString-Footer-2"][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter "MeterString-Footer-2"][!Redraw]
...
Same applies to all meters of all those skins.[/list]
Hi again

Re The Toggle bang, Originally I could not get it io work with !Activate, Yincognito said it was because it was already Active and made a few suggestions one being I change it to !Deactivate followed by ! Activate in the same mouse click which worked perfectly, So I removed the Toggle.
I do have some old backups so I could find the original code if you wanted to see it. But from my point of view, once it was working I moved on. This project changes quite a lot every day.

I think am at the limit of my understanding at the moment, I think I reached saturation point, at least for a while. Please remember I wrote the first line of any code in my entire life less than three weeks ago, I have read your advice above about four times, and my mind keeps switching off (I understand most of what you say in isolation, but my head loses track of it by the time I get half way through). But I promise I will go through it again (repeatedly) if I have to until I do understand it, but I can't comment on it at the moment because it's not sinking in.

I am adding a new help section the buttons to load and unload it are below, It works perfectly to both load and unload the first time you use them, but then they stop working. Can you see at a glance what's wrong, (In nice simple beginners terms) I have pasted it below.

Code: Select all

[HideHelp]
Meter=Button
ButtonImage=#@#Buttons\HideHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Hide Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
Buttoncommand=[!RainmeterShowMeter HideHelp][!RainmeterHideMeter ShowHelp][!DeactivateConfig "Stargates\Remote-Help" "Remote-Help.ini"]
Hidden=1

[ShowHelp]
Meter=Button
ButtonImage=#@#Buttons\ShowHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Show Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
Buttoncommand=[!RainmeterShowMeter HideHelp][!RainmeterHideMeter ShowHelp] [!ActivateConfig "Stargates\Remote-Help" "Remote-Help.ini"]

I have to rush, as I'm still coding this and want to get back before I forget what I'm doing.

ALSO, I have ask Yincognito the same question, not because I doubt either of you but simply because I have been talking to both of you and didn't don't want either of you thinking I favoured the other, but let me know for next time whether asking two Sages the same question is a no no.

Keith

Thank you again for your time and patience with me, I can promise you it's not a waste of time, It all sinks in "Eventually" LOL
Last edited by balala on April 18th, 2023, 4:13 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

Yincognito wrote: April 18th, 2023, 12:47 pm

You're correct, tinting images (and optionally resizing them at the same time via the ActionTimer plugin) is a cool way to "activate" buttons on hover, click or even both:
That is really cool BTW... Obviously I 'm not using it, just to be clear what I meant, is, I could have used exactly the same buttons on the dark side of the remote by simply tinting the ones I had on the front. I'm not doing anything anywhere near that sophisticated.BTW, Improved the tinting and made some new buttors so dark side looks better now.

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 18th, 2023, 12:47 pm
Ignore my last question, see what I mean about over I'm thinking the answer is simply

Code: Select all

[ShowHideHelp]
Meter=Button
ButtonImage=#@#Buttons\ShowHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Show - Hide - Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
Buttoncommand=[!ToggleConfig "Stargates\Remote-Help" "Remote-Help.ini"]
Keith
Last edited by balala on April 18th, 2023, 6:13 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

balala wrote: April 18th, 2023, 6:30 am

Sorry ignore my last question, but see what |I mean about I'm overthinking things the answer is simple, and goes back to the [!Toggle etc}, It's simply
One button

Code: Select all

[ShowHideHelp]
Meter=Button
ButtonImage=#@#Buttons\ShowHelp.png
X=470
Y=745
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "Show - Hide - Help"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
Buttoncommand=[!ToggleConfig "Stargates\Remote-Help" "Remote-Help.ini"]

Keith
Last edited by balala on April 18th, 2023, 6:12 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.