zivallh wrote: ↑November 10th, 2020, 11:51 am
Is it possible to copy the downloaded file and rename it continuously like Unsplash01 Unsplash02 Unsplash03, if i make Mouse action to save it
Yep, it definitely is. You have to use a RunCommand plugin measure. But there is an issue: you can't use a LeftMouseUpAction option on a measure, just on a meter (you did use it on the [Webparser] measure). It doesn't work on measures, so I did the copying a little bit differently. Whenever the [Webparser] measure downloads a new image, it is copied to the appropriate location. If this is not exactly what you want, let me know to modify the code.
So, here is my approach. Add the following measure to your code:
Code: Select all
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=copy "[Webparser]" "#Path#\Unsplash#Count#.jpg"
State=Hide
DynamicVariables=1
Note that in this measure the file is copied to to the location defined into the Path variable, within the [Variables] section. You have to add it there. It is the path of the folder (not addint the file name as well) where you want to copy the image. For instance:
With this variable, the images will be copied as
d:\Unsplash02.jpg,
d:\Unsplash03.jpg and so on. Obviously you can modify the path as you want.
There is another measure you have to add. Add the following one as well:
Code: Select all
[MeasureCount]
Measure=Calc
Formula=( MeasureCount + 1 )
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.)$":"0\1"
OnChangeAction=[!SetVariable Count "[MeasureCount]"][!WriteKeyValue Variables Count "[MeasureCount]"][!UpdateMeasure "MeasureRun"]
UpdateDivider=-1
See that you get never updated this measure (except the very first moment, after you refresh / load the skin), due to its
UpdateDivider=-1 option. We gonna update this measure whenever the WebParser measure downloads a new image.
Replace the FinishAction option of the [Webparser] measure with the following one:
FinishAction=[!SetWallpaper "DownloadFile\Unsplash.jpg"][!UpdateMeasure "MeasureCount"][!CommandMeasure "MeasureRun" "Run"]. Every time the measure downloads an image, these bangs are executed, so the !SetWallpaper bang sets the wallpaper, the !UpdateMeasure bang updates the [MeasureCount] measure, increasing its value by one and finally[Youtube][/Youtube] the !CommandMeasure bang runs the [MeasureRun] measure (posted above). Since the value of the [MeasureCount] measure is updated by the above FinishAction option, it changes, so the
[!SetVariable Count "[MeasureCount]"] bang sets a new value for the Count variable, the
[!WriteKeyValue Variables Count "[MeasureCount]"] bang writes this value into the [Variables] section and the
[!UpdateMeasure "MeasureRun"] bang updates the [MeasureRun] measure, in order to let it to use the new value of the variable.
You also have to remove one option: the UpdateRate=-1 option of the [Webparser] measure doesn't seem to be alright. If you use it, you never get update this measure, so it never downalods a new image, after you get downloaded the first. I'd remove it.
The above procedure has a great disadvantage: if you refresh the skin, you get the counting of the Count variable form the begining, you the first images will be rewritten. Please let me know if you want to countinue the counting, to keep all previously downloaded image (which I suppose), because such in a case we have to modify a little bit the above procedure. It probably is possible, but I didn't do it so far, waiting first you to test it and let me know how does it work, if it is alright.