It is currently November 25th, 2020, 2:37 pm

Copy file and rename it continuously

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

Re: Copy file and rename it continuously

Post by balala »

zivallh wrote: November 12th, 2020, 12:03 pm This is exactly what I'm looking for, simply to set wallpaper if I like the wallpaper there is a button to save it .
Not clear at all: there is a button to save the wallpaper? And would you like another one to set the current image as wallpaper?
The simplest solution would be to save it with a click on the image (as is it done now) and set the wallpaper with a right click (or vice-versa).
zivallh wrote: November 12th, 2020, 12:03 pm I Have changed the UpdateRate=-1 in Webparser so only if i want to change the wallpaper I click on the button "[Background]"
You had this option onto the original code as well. Its disadvantage is that you get an image when you load / refresh the skin, but it never changes. The image is kept until a manual update of the [Webparser] measure.
zivallh wrote: November 12th, 2020, 12:03 pm But should I use the old code or the new one for updating the wallpaper I think both codes can work!
See my answer to your first question above.
User avatar
zivallh
Posts: 16
Joined: October 16th, 2019, 2:26 pm

Re: Copy file and rename it continuously

Post by zivallh »

Sorry for late reply!

I have attached the full skin, you will got my idea when you see it

I'm using this skin to change my wallpaper randomly, so I have add button to save the wallpaper if I like to use it another time.

Down arrow to download the image, and if you click the background of the skin it's change the wallpaper, middle click to open the download folder.

Just check if my code is right, and if you can make it not load the picture after refresh
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11807
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Copy file and rename it continuously

Post by balala »

zivallh wrote: November 15th, 2020, 6:22 am Just check if my code is right,
There is a small inadvertance: when you are executing an ActionList of an ActionTimer plugin measure, is a good idea to stop the previously ran list, otherwise you get error messages in log. For instance you have the following MouseOverAction and MouseLeaveAction options on the [Background] meter:

Code: Select all

[Background]
...
MouseOverAction=[!CommandMeasure "MeasureFade" "Execute 1"][!CommandMeasure "MeasureFade2" "Execute 1"]
MouseLeaveAction=[!CommandMeasure "MeasureFade" "Execute 2"][!CommandMeasure "MeasureFade2" "Execute 2"]
If you check the log, you'll see that with these option, if you're hovering and leaving quickly more times one after the other the [Background] meter with the mouse, you get error messages in log. To avoid this, you have to add options to stop the measure(s) if you're for example leaving the meter before the execution of a list is finished. You can do this extremely simply, for instance this way:

Code: Select all

[Background]
...
MouseOverAction=[!CommandMeasure "MeasureFade" "Execute 1"][!CommandMeasure "MeasureFade" "Stop 2"][!CommandMeasure "MeasureFade2" "Execute 1"][!CommandMeasure "MeasureFade2" "Stop 2"]
MouseLeaveAction=[!CommandMeasure "MeasureFade" "Stop 1"][!CommandMeasure "MeasureFade" "Execute 2"][!CommandMeasure "MeasureFade2" "Stop 1"][!CommandMeasure "MeasureFade2" "Execute 2"]
See the newly added !CommandMeasure bangs, with the Stop X parameters. If you're appling the above options, you get no errors in the log, no matter how quickly are you hovering the mouse over / leaving the meter.
zivallh wrote: November 15th, 2020, 6:22 am and if you can make it not load the picture after refresh
Yep, replace the FinishAction option of the [Webparser] measure with the following one:
FinishAction=[!UpdateMeasure "MeasureCount"][!Delay "2000"][!SetOption Webparser FinishAction """[!UpdateMeasure "MeasureCount"][!SetWallpaper "DownloadFile\Unsplash.jpg"]"""]
With this option, the first time after you refresh / load of the skin, the FinishAction doesn't have a !SetWallpaper bang, which could set the wallpaper, but 2 seconds (due to the [!Delay "2000"] bang of the above option) after you get executed the measure, the FinishAction option is replaced by another which has the !SetWallpaper bang as well. After this moment (so from the second update of the measure), everytime the measure is updated you get set a new wallpaper.
Not too advantageus, because you never know what wallpaper will you set when you click the "button". I'd modify the code in a way to display the last downloaded image in a way, then apply it only if you like the image.
User avatar
zivallh
Posts: 16
Joined: October 16th, 2019, 2:26 pm

Re: Copy file and rename it continuously

Post by zivallh »

Thank you balala)

You are gorgeous! :)

it's fine for me like that, I don't know how it will be, it will have a preview before sit it as wallpaper?

for the "FinishAction" I think it must be like this because each time you click the next "background" wallpaper it's count and update the variables, so when you save click the save button after many times of changing the wallpaper it will save the image with gap count between the names like 10 13 17

Code: Select all

FinishAction=[!Delay "2000"][!SetOption Webparser FinishAction """[!SetWallpaper "DownloadFile\Unsplash.jpg"]"""]
The update measure count must be in the download button only

Code: Select all

[Download]
Meter=Image
ImageName=#@#Images/Download.png
ImageRotate=90
X=(125*#Scale#)
Y=(12*#Scale#)
W=(20*#Scale#)
LeftMouseUpAction=[!UpdateMeasure "MeasureCount"][!CommandMeasure "MeasureRun" "Run"]
DynamicVariables=1
User avatar
zivallh
Posts: 16
Joined: October 16th, 2019, 2:26 pm

Re: Copy file and rename it continuously

Post by zivallh »

I have updated the fade effect using jsmorley method

https://forum.rainmeter.net/viewtopic.php?f=119&t=29503

it's working fine

Thank you again for your help I appreciate it!
User avatar
balala
Rainmeter Sage
Posts: 11807
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Copy file and rename it continuously

Post by balala »

zivallh wrote: November 16th, 2020, 11:19 am it's fine for me like that, I don't know how it will be, it will have a preview before sit it as wallpaper?
Glad if you got it working well.
If the above question is related to my idea about adding an Image meter to preview the wallpaper which will be applied when you update the [Webparser] measure (so when you click the [Background] meter), than there is a problem. If an image is not downloaded, you can't preview it. But when you download it (updating the [Webparser] measure), you get it applied immediately as wallpaper. So we have to use another approach. Question is if you are interested.
zivallh wrote: November 16th, 2020, 11:19 am for the "FinishAction" I think it must be like this because each time you click the next "background" wallpaper it's count and update the variables, so when you save click the save button after many times of changing the wallpaper it will save the image with gap count between the names like 10 13 17
Not sure I can follow this. When I load the skin, the counter is set to 1, then on each click, the counter increases by one. Does it work in other way for you?
User avatar
zivallh
Posts: 16
Joined: October 16th, 2019, 2:26 pm

Re: Copy file and rename it continuously

Post by zivallh »

it's working well)

for me it's fine without preview.

if we add [!UpdateMeasure "MeasureCount"] in the "FinishAction" it will update the count each time you change the wallpaper, so when you save the image after many times of changing the wallpaper, it will save by the count in variables.


it has only to be in the save button like this, to update the count in the variables if we save the image only

Code: Select all

LeftMouseUpAction=[!UpdateMeasure "MeasureCount"][!CommandMeasure "MeasureRun" "Run"]
User avatar
balala
Rainmeter Sage
Posts: 11807
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Copy file and rename it continuously

Post by balala »

zivallh wrote: November 17th, 2020, 6:35 am if we add [!UpdateMeasure "MeasureCount"] in the "FinishAction" it will update the count each time you change the wallpaper, so when you save the image after many times of changing the wallpaper, it will save by the count in variables.


it has only to be in the save button like this, to update the count in the variables if we save the image only

Code: Select all

LeftMouseUpAction=[!UpdateMeasure "MeasureCount"][!CommandMeasure "MeasureRun" "Run"]
Good, modify the above LeftMouseUpAction as you described.
However beside this, let's summarize, because I'm not sure anymore what else should be done.
So, do we have to change anything in how the skin is working?
User avatar
zivallh
Posts: 16
Joined: October 16th, 2019, 2:26 pm

Re: Copy file and rename it continuously

Post by zivallh »

No that's fine thank you so much!
User avatar
balala
Rainmeter Sage
Posts: 11807
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Copy file and rename it continuously

Post by balala »

zivallh wrote: November 17th, 2020, 11:30 am No that's fine thank you so much!
You're welcome.