It is currently April 26th, 2024, 12:44 pm

Need help with image file copy after download

Get help with creating, editing & fixing problems with skins
rakibdepu
Posts: 9
Joined: October 9th, 2020, 4:43 pm

Need help with image file copy after download

Post by rakibdepu »

For my skin, I wanted to copy after download. I've tried many things but it didn't seem to work as I would like it to.

My Skin File:
RHD_Clock.zip

Regards,
rakibDepu
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with image file copy after download

Post by balala »

rakibdepu wrote: October 22nd, 2020, 7:21 am For my skin, I wanted to copy after download. I've tried many things but it didn't seem to work as I would like it to.
rakibDepu
You need a RunCommand plugin measure to do this. Add the following measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=xcopy "[Measure_PIC]" "d:\"
State=Hide
DynamicVariables=1
The second parameter of the xcopy command in the Parameter option of the above measure has to be the path where would you like to copy the downloaded file. In this example it is d:\, but you can use the desired folder, just take care to add a backslash to the end.
And one more thing you have to do: add two bangs to the FinishAction option of the [Measure_PIC] measure, as it follows: FinishAction=[!UpdateMeasure "MeasureSize"][!UpdateMeasure "MeasureRun"][!CommandMeasure "MeasureRun" "Run"]
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Need help with image file copy after download

Post by rbriddickk84 »

Hi there!

It's strange, the only thing i changed was the "DynamicVariables=1" from "UpdateDivider=-1" in the "MeasureScript", and it worked for me. :ThinkingBig
Probably that is why you would need to update the "MeasureRun" measure as well like Balala said, when you use UpdateDivider! :)
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with image file copy after download

Post by balala »

rbriddickk84 wrote: October 22nd, 2020, 8:39 pm It's strange, the only thing i changed was the "DynamicVariables=1" from "UpdateDivider=-1" in the "MeasureScript", and it worked for me. :ThinkingBig
Probably that is why you would need to update the "MeasureRun" measure as well like Balala said, when you use UpdateDivider! :)
:o Sorry, my bad, I just didn't realized there already is a [MeasureRun] measure and a FileCopy.lua script file. I simply missed them. My usual inatention (not first time)...
So I didn't say to update the [MeasureRun] measure, but to add it, because as said, I didn't realize there already is such a measure.
Ok, I'm gonna fix my mistake immediately...
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with image file copy after download

Post by balala »

Ok, I hope I figured out how to fix this.
Starting from the beginning, from rakibdepu's original skin, here is what should be done in order to get the image copied as expected:
  • Remove the [GetWidth], [GetHeight] and [MeasureSize] measures. We don't need them.
  • Remove the [MeasureScript] measure as well and the FileCopy.lua file as well from the config. We don't need these either.
  • Finally replace the [!UpdateMeasure "MeasureSize"] bang of the FinishAction option of the [Measure_PIC] measure with the following one: [!CommandMeasure "MeasureRun" "Run"]: FinishAction=[!CommandMeasure "MeasureRun" "Run"]. Note that since we've removed the [MeasureSize] measure, we don't have to and can't even update it either anymore.
That's it, I hope. Tested and it does work now for me. Does it for you as well?
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Need help with image file copy after download

Post by rbriddickk84 »

balala wrote: October 23rd, 2020, 5:27 pm
  • Remove the [GetWidth], [GetHeight] and [MeasureSize] measures. We don't need them.
  • Remove the [MeasureScript] measure as well and the FileCopy.lua file as well from the config. We don't need these either.
  • Finally replace the [!UpdateMeasure "MeasureSize"] bang of the FinishAction option of the [Measure_PIC] measure with the following one: [!CommandMeasure "MeasureRun" "Run"]: FinishAction=[!CommandMeasure "MeasureRun" "Run"]. Note that since we've removed the [MeasureSize] measure, we don't have to and can't even update it either anymore.
I'll be honest, i was removing those codes as well, because i didn't know if there was more to the original code, just not mentioned here, or other.
But yes, i was using the same method that "jsmorley" used in his original script.:
https://forum.rainmeter.net/viewtopic.php?t=19223

And no worries balala, it's not nearly that big of a mistake :D if it's a mistake at all! ;)I am struggling with a problam as well, but i will maybe ask fo help in another topic. :)

Hope that everyone will get things to work! :D
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with image file copy after download

Post by balala »

rbriddickk84 wrote: October 23rd, 2020, 7:05 pm And no worries balala, it's not nearly that big of a mistake :D if it's a mistake at all!
Yep, it definitely was a big mistake from my part. As said, I didn't even realized there is a RunCommand plugin measure to copy the image and added a second measure, with the same name. Also didn't realize there is a script measure, however that was not needed in fact.
rbriddickk84 wrote: October 23rd, 2020, 7:05 pm I am struggling with a problam as well, but i will maybe ask fo help in another topic. :)
Feel free to ask if you have problems. Someone here will try to help you for sure.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Need help with image file copy after download

Post by rbriddickk84 »

balala wrote: October 23rd, 2020, 7:15 pm Yep, it definitely was a big mistake from my part. As said, I didn't even realized there is a RunCommand plugin measure to copy the image and added a second measure, with the same name. Also didn't realize there is a script measure, however that was not needed in fact.
I looked outside through my window, and the world is still in tact my friend ;D Don't be so judgeful on yourself, it's a small hickup, you will look more next time :thumbup:

And thank you for your kind comment!
rakibdepu
Posts: 9
Joined: October 9th, 2020, 4:43 pm

Re: Need help with image file copy after download

Post by rakibdepu »

balala wrote: October 23rd, 2020, 5:27 pm Ok, I hope I figured out how to fix this.
Starting from the beginning, from rakibdepu's original skin, here is what should be done in order to get the image copied as expected:
  • Remove the [GetWidth], [GetHeight] and [MeasureSize] measures. We don't need them.
  • Remove the [MeasureScript] measure as well and the FileCopy.lua file as well from the config. We don't need these either.
  • Finally replace the [!UpdateMeasure "MeasureSize"] bang of the FinishAction option of the [Measure_PIC] measure with the following one: [!CommandMeasure "MeasureRun" "Run"]: FinishAction=[!CommandMeasure "MeasureRun" "Run"]. Note that since we've removed the [MeasureSize] measure, we don't have to and can't even update it either anymore.
That's it, I hope. Tested and it does work now for me. Does it for you as well?
Thanks for help, but i'm bit confused.

It does work but after some time image download got error, that's why i add [GetWidth], [GetHeight] and [MeasureSize] measures.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Need help with image file copy after download

Post by rbriddickk84 »

What kind of error do you get?

Also i noticed your main update rate is 100 only, it can take some performance impact globally. At least for me, and usually better to go with minimum 1000 and then in the other measures and meters should control separatly those. Like with "WebParser" the "UpdateRate"