It is currently July 2nd, 2024, 7:52 am

Running VBS script from button

Get help with creating, editing & fixing problems with skins
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

LuciferVisuals wrote: April 15th, 2023, 9:09 pm


Log? Ermm, Log???

Hi Found the log and the error message ..\ means back to the root doesn't it? so C:\ If I'm not mistaken, so no idea why so many, as I said I didn't write that line. Never even noticed it, it wasn't causing a problem or related to the parts I was revising. And in the absence of any knowledge tat there was an error log that (Thank you again, I will use that often now) I assumed it was working so left it alone.

But I have fixed the problem, I simply deleted the entire line.

The code was looking for a cursor that wasn't there. So either I had to put that cursor in my resources, where it expected it to be, OR put a different one there, and then revise the code. However I opted for "plan C" delete the entire line, as it does not appear to be doing anything useful. I tested it and it all works with no error message now. But I will play with it more to make sure in case I have to stick a cursor in the resources. I did have a quick look at the original, and it didn't have the aero cursor in his resources. SO I think its just leftover from when the original author was playing about with it, and they forgot to remove the line, well that's what I think..


Thanks for pointing it out.

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

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 15th, 2023, 9:16 pmMine or the Original, or Both?
I think he meant the original, because he linked to it. Probably because even though it looks like a lock screen (and a nice one too), a Rainmeter skin can never be such a screen, since it can easily be unloaded by everyone - something that has been pointed out in the original thread too.
LuciferVisuals wrote: April 15th, 2023, 9:09 pmThe line of code you mentioned above I didn't touch. It appeared to be working ok so I left it alone, TBH I have no idea what those are, I took a fair bit of time understanding the parts that were broken, then more time fixing them and even more time adding much needed improvements.
The double dot (..) is a relative path pointing out to the parent folder of the current folder (whatever that might be). What that line meant was [parentofthisfolder]\[parentofpreviousfolder]\[parentofpreviousfolder]\..., which was a really long, unreliable and cumbersome way of referring to a simple path like C:\Windows\Cursors\aero_arrow.cur (or even better, %WINDIR%\Cursors\aero_arrow.cur). Why unreliable? Simple: because if you change the path of the skin, that relative path becomes easily broken.

Of course, that was not your doing, since it was present in the original skin as well - but then, doing what he does, balala is usually quite scrupulous in pointing out all the details regarding making a code better. In other words, it wasn't personal and he wasn't criticizing your work, it's just that he really is that thorough all the time, and with everyone. :sly: It's his way of being as serious and professional as he can when helping out. ;-)
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 15th, 2023, 10:28 pm

The double dot (..) is a relative path pointing out to the parent folder of the current folder (whatever that might be). What that line meant was [parentofthisfolder]\[parentofpreviousfolder]\[parentofpreviousfolder]\..., which was a really long, unreliable and cumbersome way of referring to a simple path like C:\Windows\Cursors\aero_arrow.cur (or even better, %WINDIR%\Cursors\aero_arrow.cur). Why unreliable? Simple: because if you change the path of the skin, that relative path becomes easily broken.

Of course, that was not your doing, since it was present in the original skin as well - but then, doing what he does, balala is usually quite scrupulous in pointing out all the details regarding making a code better. In other words, it wasn't personal and he wasn't criticizing your work, it's just that he really is that thorough all the time, and with everyone. :sly: It's his way of being as serious and professional as he can when helping out. ;-)

Funny enough that line was giving an error after some thought I decided the line was not only wrong, but not doing anything so removed it. All worked fine no errors, But out of curiosity I then put this line in;

MouseActionCursorName=aero_link_xl.cur (After putting a cursor directory in my resources with that cursor it. Appears to work)

But that works but causes a new error !SetOption: Skin "Enter" not found. SO I took the line out again, I have only just discovered the Log file (Balala pointed it out to me). But I have already spent much longer on that file than I intended. BTW Did you see my revised version?

On the other matter; No need to apologise he has been really helpful, I have learnt a lot from him and he has been great, I asked him to point out anything I can do better, I was prob being a bit defensive pointing out I didn't actually write that, so have no idea what the original author had in mind. I'm in my seventies with my first computer (since Christmas). TBH I'm feeling pretty pleased with myself, but getting to information overload point. Prob need to just consolidate what I have managed to get down, and finish what I'm doing before trying to get my head around much new stuff, unless its essential to what I'm doing.

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 15th, 2023, 10:28 pm


The double dot (..) is a relative path pointing out to the parent folder of the current folder
Oh yeah! I got it wrong it's not go to the root directory its go back one directory (towards the root), think I was getting confused with the dos prompt where cd. is go back one and cd.. is go back to root, I just sort of assumed the \.. meant go back to the root. BUT I GOT IT NOW. Thanks it means that now I see why he had so many \.. one after another. (He was a long way from the root, and working his way back, so he could go forward into windows\cursors\a_cursor.cur) and I also why it's a fragile or vulnerable way of doing things. But at least I get it now. I still decided to remove it altogether, it's not doing anything, apart from trying to change the cursor, I might play with it when I have nothing else to do. (LOL).

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

Re: Running VBS script from button

Post by Yincognito »

LuciferVisuals wrote: April 15th, 2023, 11:16 pmMouseActionCursorName=aero_link_xl.cur (After putting a cursor directory in my resources with that cursor it. Appears to work)

But that works but causes a new error !SetOption: Skin "Enter" not found. SO I took the line out again, I have only just discovered the Log file (Balala pointed it out to me). But I have already spent much longer on that file than I intended. BTW Did you see my revised version?
The way you adjusted it should work, if you put the cursor in the ...\@Resources\Cursors folder.

The error you mention is most likely related to either some leftover space between parts of a bang (in this case, !SetOption), or some quotes that are needed to instruct Rainmeter to treat some string as a single "unit". For example, if you have [!SetOption SomeMeter SomeOption SomethingHere SomethingElse] and you don't enclose "SomethingHere SomethingElse" between quotes, Rainmeter will expect that SomethingElse refers to a skin, since this is the 4th (optional) parameter in a !SetOption bang. In other words, in bangs, quotes and spaces are ways to define the parameters and where they begin and end. The error is almost certainly related to a "misunderstanding" between you and Rainmeter in regard to that.

No, I didn't check your revised skin - I was just following the discussion from a distance, given the fact that balala was already on top of the whole thing. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16367
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 15th, 2023, 9:09 pm The line of code you mentioned above I didn't touch.
Alright, I see. But in this case I recommend you to remove that option because:
  • It doesn't work anyway on any computer excepting yours.
  • Gives an error message in the log.
Since Yincognito explained most things, I don't repeat what he wrote. Hope you got it. If you didn't, please let me (us) know.
LuciferVisuals wrote: April 15th, 2023, 9:16 pm Mine or the Original, or Both?
The original one. Yours is alright, especially if it's a code you're learning on. Finally you have to start from one, doesn't really matter which one are you doing this with.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

balala wrote: April 16th, 2023, 6:19 am
Hope you got it. If you didn't, please let me (us) know.

Finally you have to start from one, doesn't really matter which one are you doing this with.
Hi, Yes got it and further improved it, I struggled with that code as I didn't write it in the first place, found that much harder than working from scratch.

Thanks for the info on the error log, I hate you for it though. (LOL thats a joke btw) I now have 16 interactive skin all mine, Plus the childlick. The log revealed about 20 actual errors (2 in that child lock and one in each on my original skins) Plus a lot of warnings, probably about 30. It has taken all day but I have fixed all the errors including the ChildLock (which is even better now), and while none of the warnings were really important, I found and fixed every one of them.

I did not understand what you meant in the last part of your message about you have to start from one? If you mean from one shin, its all set up that way, I have not got as far as figuring out how to make rainmeter always start with that one. I have not tried yet. It's only skin in my stargate directory, all the others are in sub directories. Its called Little-Remote.ini Because its the size of a desktop Icon, when you click on it a full sized remote appears. If that's what you meant?

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

Re: Running VBS script from button

Post by balala »

LuciferVisuals wrote: April 16th, 2023, 5:10 pm Thanks for the info on the error log, I hate you for it though. (LOL thats a joke btw)
Yep, I figured this out.
LuciferVisuals wrote: April 16th, 2023, 5:10 pm I now have 16 interactive skin all mine, Plus the childlick. The log revealed about 20 actual errors (2 in that child lock and one in each on my original skins) Plus a lot of warnings, probably about 30.
Don't worry, we all have errors on our skins from time to time. If you didn't look so far to the log and didn't fix the errors, 20 errors and around 30 warnings is not too much at all.
LuciferVisuals wrote: April 16th, 2023, 5:10 pm It has taken all day but I have fixed all the errors including the ChildLock (which is even better now), and while none of the warnings were really important, I found and fixed every one of them.
I have to congratulate you if you succeeded in fixing all of them. Congratulations. :great:
LuciferVisuals wrote: April 16th, 2023, 5:10 pm I did not understand what you meant in the last part of your message about you have to start from one? If you mean from one shin, its all set up that way, I have not got as far as figuring out how to make rainmeter always start with that one. I have not tried yet. It's only skin in my stargate directory, all the others are in sub directories. Its called Little-Remote.ini Because its the size of a desktop Icon, when you click on it a full sized remote appears. If that's what you meant?
I meant that usually users takes a skin and start altering it, in order to get it as they want it to be. I said about the original code that I don't like it. But that has been written by an experienced user. You altered it in your way and the result is alright, so the original Lock Screen skin has been the one you started with (I assume).
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: Running VBS script from button

Post by LuciferVisuals »

balala wrote: April 16th, 2023, 6:08 pm
I meant that usually users takes a skin and start altering it, in order to get it as they want it to be. I said about the original code that I don't like it. But that has been written by an experienced user. You altered it in your way and the result is alright, so the original Lock Screen skin has been the one you started with (I assume).
No, Actually I had written ten of my own, they were far from finished, but when I started adding vbs files (which I have put on hold for the moment) I realised that this would not be a good idea if kids got their fingers on them, I have grandchildren who love to sit on my lap and bash the computer keyboard. So I realised I wanted to put a child-lock of some sort on my project, started looking for ideas and found the broken rainlock. Even then it was a nightmare to try and understand how it worked, never mind fix it, If I had found that one first it would pf probably put me off TBH. (Even now it gives me a headache, I find it hard to follow, the logic jumps all over the place, and its using IF IFMatch IFNot etc, none of which are in any of my skins Execute Commands etc.(Not the type of Execute you can remove either.) (Even more now I added some stuff to it).

I attached my latest version in case you want to look at it, you already have the image.

There is something you could help me with if you are feeling generous ??? (Said he hopefully)

I'M using the code below to launch the Childlock.ini, from all my other skins, which are all in the same directory ("Stargates\Remote-idle") "EXCEPT Childlock.ini which is in "Stargates\Childlock" Childlock.ini

Code: Select all

[LockButton]
Meter=Button
ButtonImage=#@#Buttons\Lock.png
X=291
Y=153
W=46
H=46
MouseOverAction=[!SetOption MeterString-Footer-2 FontColor "209,206,113,255"][!SetOption MeterString-Footer-2 Text "LOCK COMPUTER"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption MeterString-Footer-2 FontColor "0,0,0,255"][!SetOption MeterString-Footer-2 Text "#Footer-Message-2#"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=!ToggleConfig "Stargates\Childlock" "Childlock.ini"
Only the last line matters IMHO, but I Included the whole thing just in case.

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 that's not possible I have thought of a "workaround" and that's a message to appear after the first click saying "Click again to lock your computer"

I have tried pretty hard but so far cannot do either of these things. So ATM I'm stuck with two clicks (NOT A DOUBLE CLICK- has have about half a second between them). The work around would make it look intentional, in case you accidentally clicked the lock button.

Any insight "Oh Wise One"

If you have a spare 5 mins check my revised code, I think you will approve.

Keith
You do not have the required permissions to view the files attached to this post.
Last edited by balala on April 17th, 2023, 5:19 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 16th, 2023, 6:08 pm
So the original Lock Screen skin has been the one you started with (I assume).
This was my first one, I think it's more or less finished now. It's part of a set, I did post it earlier but it has changed a lot since then.

Keith

OH thats number 11 in a series, I was intending sending Remote-Active-1.ini, 11 is one of the newer ones I'm still working on and the fact it starts with the word OLD, means it had major revision today, and so that's probably got a lot of less than perfect code, I wrote it late last night. I copied it this morning then added the word OLD to the front of it in case my revisions to the working copy totally messed it up. As they all worked I'll delete all the old ones now. My mistake was caused by the way file explorer drops the second 1 onto a new line, I was aiming for Remote-Active-1.ini.

I tried to delete this and send the correct one, but it didn't work. Still It was only to show you the difference between my code, which is much more basic, (but longer), than the code in Childlock.ini, which is more complicated and advanced than mine.
You do not have the required permissions to view the files attached to this post.