It is currently January 17th, 2019, 1:33 am

Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

Share your custom plugins and applications to enhance Rainmeter.
Marian
Posts: 7
Joined: March 19th, 2017, 8:14 am

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

Marian » March 19th, 2017, 8:57 am

ReplaceIfExists=1 does not work for me. I use Rainmeter 4.0 64-bit, Drag&Drop v3.1.0.3.

Here is my code:

Code: Select all

[DragNDropParent]
Measure=Plugin
Plugin=Drag&Drop

[MeasureDropIconForCurrentShortcut]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=ShortcutDropImageHere_Background
Action=Copy
FilePath=#@#Icons
ReplaceIfExists=1
OnDropAction=[!CommandMeasure "Script" "saveCurrentShortcutIconDropped('$Name$.$Type$')"]
I tried copying/moving two different image files and nothing. Did I do something wrong?
Marian
Posts: 7
Joined: March 19th, 2017, 8:14 am

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

Marian » March 19th, 2017, 11:09 am

Marian wrote:ReplaceIfExists=1 does not work for me. I use Rainmeter 4.0 64-bit, Drag&Drop v3.1.0.3.

Here is my code:

Code: Select all

[DragNDropParent]
Measure=Plugin
Plugin=Drag&Drop

[MeasureDropIconForCurrentShortcut]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=ShortcutDropImageHere_Background
Action=Copy
FilePath=#@#Icons
ReplaceIfExists=1
OnDropAction=[!CommandMeasure "Script" "saveCurrentShortcutIconDropped('$Name$.$Type$')"]
I tried copying/moving two different image files and nothing. Did I do something wrong?
I downloaded the code from GitHub and found a solution to above issue:

ReplaceIfExists=1 replaced by OverrideExisting=1 and works fine.

Btw I found other issue:

when I have several measures enjoying the plug-in then regardless of which I use at this moment, these are executed event OnDropAction for each of them! It should not work like this.

Code:

Code: Select all

[DragNDropParent]
Measure=Plugin
Plugin=Drag&Drop

[MeasureDropIconForTrashEmpty]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=whatever
Action=Copy
FilePath=#@#Icons
OverrideExisting=1
OnDropAction=[!CommandMeasure "Script" "saveTrashEmptyIconDropped('$Name$.$Type$')"]
DynamicVariables=1

[MeasureDropIconForTrashFull]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=whatever
Action=Copy
FilePath=#@#Icons
OverrideExisting=1
OnDropAction=[!CommandMeasure "Script" "saveTrashFullIconDropped('$Name$.$Type$')"]
DynamicVariables=1
Same can be observed in example:

Code: Select all

[DragNDropParent]
Measure=Plugin
Plugin=Drag&Drop

[DragNDropChild1]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=0,0,100,200
Action=Path
OnDropAction=[!Log "You dropped a file in the first child!"]

[DragNDropChild2]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=DropMeter2
Action=Path
OnDropAction=[!Log "You dropped a file in the secound child!"]

[DropMeter1]
Meter=Image
W=100
H=200
SolidColor=255,255,255

[DropMeter2]
Meter=Image
X=200
W=100
H=200
SolidColor=255,255,255
Any ideas to solve my issue ?
User avatar
theAzack9
Developer
Posts: 500
Joined: March 2nd, 2016, 6:23 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

theAzack9 » March 19th, 2017, 1:32 pm

@Marian

Seems at some point during the 3.1. upgrade things got really unstable...
I'll probably go through and fix a lot of things in the near future when i have the time.
Also, i forgot that i even have a github repository... That thing is probably pretty old by now, i'll make sure to update it when i push for 3.2 :)
Thanks for looking into this, i'll add it to the todo-list and i'm sorry for all the struggle the bugs has cause :P
3rdTraveler
Posts: 2
Joined: April 26th, 2017, 6:51 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

3rdTraveler » April 28th, 2017, 10:27 pm

Hi!, Nice plugin!, I've tried to make a skin using it, but, I have a problem, I have to copy one image to a specified location, I actually solved it, but, I want to copy it with a diferent name, and I don't know how to do it, Can someone help me please?; and, I have a question, can I upload my skin to DVArt with the plugin included? I would add the rights for the creator of the plugin. Thanks!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3129
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

eclectic-tech » April 29th, 2017, 12:13 am

3rdTraveler wrote:Hi!, Nice plugin!, I've tried to make a skin using it, but, I have a problem, I have to copy one image to a specified location, I actually solved it, but, I want to copy it with a diferent name, and I don't know how to do it, Can someone help me please?; and, I have a question, can I upload my skin to DVArt with the plugin included? I would add the rights for the creator of the plugin. Thanks!
This plugin can not rename a file.
Copy? Yes! ... Rename? No!

I would be very leery of offering any skin using this plugin as it is right now; did you read the post above yours? :confused:
The author needs to work on several bugs when he gets time... which hasn't happened yet.

I would strongly advise NOT to use a buggy plugin in anything you want to make public. :uhuh:
It is fine for personal use, but to publish a buggy skin only frustrates users, and is detrimental to Rainmeter's reputation :x
User avatar
theAzack9
Developer
Posts: 500
Joined: March 2nd, 2016, 6:23 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

theAzack9 » April 29th, 2017, 10:40 am

3rdTraveler wrote:Hi!, Nice plugin!, I've tried to make a skin using it, but, I have a problem, I have to copy one image to a specified location, I actually solved it, but, I want to copy it with a diferent name, and I don't know how to do it, Can someone help me please?; and, I have a question, can I upload my skin to DVArt with the plugin included? I would add the rights for the creator of the plugin. Thanks!
While eclectic-tech already mostly answered this i thought i should just make a heads up anyways.

While i don't think the bugs in this plugin is major i would probably advice you to wait just a little longer until i'm done with the new version. (I hope to be done around next week, it isn't really that much more to do, but i have a lot of exams coming up)

There is no and probably won't be any way to rename a copied file as that is not really what i personally want this plugin to do. I do not say that this will never happen, but i'm at least against it currently. However, it is certainly possible to do with some other tool. The OnDropAction should be executed after the file itself is moved, which means that you can use the $File$ substitution to rename the file after you copied it. (E.g using the CommandMeasure with something like "rename $File$ "MyName")

You full permission to publish a skin with this plugin attached :) (I added a comment under the redistributable in case anyone in the future is confused about this)
You can download the redistributable zip file and it contains both the x32 and the x64 version you need in order to bundle it with your skin.
3rdTraveler
Posts: 2
Joined: April 26th, 2017, 6:51 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

3rdTraveler » May 6th, 2017, 5:12 pm

theAzack9 wrote:While eclectic-tech already mostly answered this i thought i should just make a heads up anyways.

While i don't think the bugs in this plugin is major i would probably advice you to wait just a little longer until i'm done with the new version. (I hope to be done around next week, it isn't really that much more to do, but i have a lot of exams coming up)

There is no and probably won't be any way to rename a copied file as that is not really what i personally want this plugin to do. I do not say that this will never happen, but i'm at least against it currently. However, it is certainly possible to do with some other tool. The OnDropAction should be executed after the file itself is moved, which means that you can use the $File$ substitution to rename the file after you copied it. (E.g using the CommandMeasure with something like "rename $File$ "MyName")

You full permission to publish a skin with this plugin attached :) (I added a comment under the redistributable in case anyone in the future is confused about this)
You can download the redistributable zip file and it contains both the x32 and the x64 version you need in order to bundle it with your skin.
Thank you very much TheAzack 9, oh, ok, That's exactly wath I needed to know, I had the doubt if it could rename a file, Now I understand more. I will try to do it in some way like you said, maybe with CMD or VBS. I'll let you know if I publish any skin with your plugin, I'm still working on it. Thanks, Good Look with your exams!
User avatar
Joker73
Posts: 14
Joined: May 17th, 2017, 6:04 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

Joker73 » May 20th, 2017, 12:05 pm

Hi! I'm creating a dock and one icon should be the recycle bin and I'd like to drag and drop files as I do with the Windows bin. I've used this code on my icon but it doesn't work. Any idea?

Code: Select all

[Ico8]
[RecycleBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count

[DragAndDrop]
Measure=Plugin
Plugin=DragAndDrop
Confirm=FALSE

[RecycleBinEmpty]
Meter=Image
MeterStyle=Ico2
ImageName=dropbox.png
W=50
H=50
Hidden=0
LeftMouseUpAction=!CommandMeasure RecycleBin OpenBin
RightMouseUpAction=NOTHING
DymamicVariables=1

[RecycleBinFull]
Meter=Image
MeterStyle=Ico2
ImageName=alvaro.png
W=50
H=50
Hidden=1
LeftMouseUpAction=!CommandMeasure RecycleBin OpenBin
RightMouseUpAction=!CommandMeasure RecycleBin EmptyBin
DymamicVariables=1

[BinCheck]
Measure=Calc
Formula=RecycleBin
IfAboveValue=0
IfAboveAction=[!HideMeter RecycleBinEmpty][!ShowMeter RecycleBinFull][!Redraw]

[BinCheck2]
Measure=Calc
Formula=RecycleBin
IfEqualValue=0
IfEqualAction=[!HideMeter RecycleBinFull][!ShowMeter RecycleBinEmpty][!Redraw]
User avatar
theimmersion
Posts: 50
Joined: November 27th, 2016, 1:51 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

theimmersion » September 6th, 2017, 8:40 pm

What about some functions to retrieve the source file location of a dropped shortcut and its icons?
If i was to make a dock, id need a function like those of FileView, only i need the ability to retrieve not just the dropped file location but instead its source location if its a shortcut and id need to extract its icon. With those functions i could make a dock just like rocket dock, and im pretty sure with what rainmeter is and can do, the rainmeter dock would be superior to any dock out there. FileView comes close but if only it could be targeted to a single file or folder directly.
I made some launchers/docks but you need to set the paths either manually editing the skins ini file for the icons and paths or, as i did, use AHK to execute windows native file picker and save the resulting path to the skins config and refresh the skin.
The problem im having with that approach is that its not intuitive at all imo. The manual editing being the least intuitive but i dont like the external file or folder picker either. One must still go through ProgramFiles etc and so much complicated coding to connect rainmeter and autohotkey when all you could do is drop a file on a box and it would retrieve the the source target path and with it the icon and icon size that you set and display it. Just a thought. In mean time, ill try rainmeter with Drag&Drop to get the file location from the files that are dropped on desktop and see if i can use AHK to get its source target instead.
Because thats what bugged me the most, i wanted any shortcuts on any dock to be linked to the source so i could delete the shortcuts. Thats what bugs me on all the docks, those shortcuts. LOL, maybe im nitpicking but still, ill a user should do is drop a shortcut and delete it afterwards and let the software do the rest. xD
Maybe im missing something, maybe someone has an idea. Lets brainstorm!

In case i didnt tell you, this plugin is AWESOME. BTW, why no rename function? I dont want to replace files blindly, it would be nice if there was a way to make a pop up to replace or rename a file. Asking because im using launchers a lot. Theres not a single shortcut on my desktop other than work in progress skins all over the place. Everything else is launchers and docks. xD
User avatar
theimmersion
Posts: 50
Joined: November 27th, 2016, 1:51 pm

Re: Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!

theimmersion » September 7th, 2017, 12:14 am

Ok, been fiddling around for a while now and i cant figure it out. Something is not right with this plugin or instructions are unclear. xD

How on earth can i have two drag and drop places in one skin without affecting all the variables?

Heres my skin:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
MouseActionCursor=1
ContextTitle=Open Icon Folder
ContextAction=["#@#Icons"]
ContextTitle2=Save
ContextAction2=[!WriteKeyValue "Variables" "vFilePathA" "#vFilePathA#"] [!WriteKeyValue "Variables" "vFilePathB" "#vFilePathB#"]

MouseOverAction=[!UpdateMeterGroup "Refresh"] [!UpdateMeasureGroup "Refresh"] [!Redraw]
RightMouseUpAction=!Refresh

[Variables]
R=[!UpdateMeterGroup "Refresh"] [!UpdateMeasureGroup "Refresh"] [!Redraw]
vFilePathA=NULL
vFilePathB=NULL

[Debug]
Meter=String
Text=DragNDropA: [DragNDropA]#CRLF#vFilePathA: #vFilePathA##CRLF##CRLF#DragNDropB: [DragNDropB]#CRLF#vFilePathB: #vFilePathB#
FontColor=255,255,255
SolidColor=0,0,0
Group=Refresh
DynamicVariables=1

;------
; A
;------

[DragNDropA]
Measure=Plugin
Plugin=Drag&Drop
Action=None
;Bounds=PlaceHolderA
;OnDropAction=[!SetVariable "vFilePathA" "$File$"] #R#

[DragNDropAChild]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
Parent=DragNDropA
Bounds=PlaceHolderA
OnDropAction=[!SetVariable "vFilePathA" "$File$"] #R#

[PlaceHolderA]
Meter=Shape
Shape=Rectangle 150,50,100,100,100| Fill Color 0,0,0,100 | StrokeWidth 2 | Stroke Color 100,100,100,255
Group=Refresh
DynamicVariables=1

[ImageA]
Meter=Image
;MeasureName=DragNDrop
ImageName=#vFilePathA#
;SolidColor=0,0,0,1
X=150
Y=50
PreserveAspectRatio=1
Group=Refresh
DynamicVariables=1


;------
; B
;------

[DragNDropB]
Measure=Plugin
Plugin=Drag&Drop
Action=None
;Bounds=PlaceHolderB
;OnDropAction=[!SetVariable "vFilePathB" "$File$"] #R#

[DragNDropBChild]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
Parent=DragNDropB
Bounds=PlaceHolderB
OnDropAction=[!SetVariable "vFilePathB" "$File$"] #R#

[PlaceHolderB]
Meter=Shape
Shape=Rectangle 300,50,100,100,10| Fill Color 0,0,0,100 | StrokeWidth 2 | Stroke Color 100,100,100,255
Group=Refresh
DynamicVariables=1

[ImageB]
Meter=Image
;MeasureName=DragNDrop
ImageName=#vFilePathB#
;SolidColor=0,0,0,1
X=300
Y=50
PreserveAspectRatio=1
Group=Refresh
DynamicVariables=1
Tried two parent approach.
Tried one parent, two children approach.
Tried, as you can see, two parents and two children approach.
But still it wont work, it sets the path to both variables even tho an image is being dropped on only one of them.
Also, you might notice, the result to the parent meters themselves is at random.
Sometimes they both get the same path, sometimes non of them, sometimes the one that was not actually dropped on and sometimes the correct one.
So weird. Did i miss something here or is it a bug?

Note: for easier testing, right click anywhere on the skin to refresh the whole skin.