It is currently May 21st, 2024, 9:36 am

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

Share and get help with Plugins and Addons
hleen
Posts: 2
Joined: January 15th, 2017, 12:34 pm

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

Post by hleen »

Hi,

thanks for this nice plugin!
I use it to call a batch file that resamples my hi-res wave files.
However, I noted a problem: the $Directory$ variable is not correct.

I drop the file "D:\My Documents\My Music\Pink.wav"
and the variables are:
$Directory$: D:\My Documents
$Name$: Pink
$Type$: wav
$File$: D:\My Documents\My Music\Pink.wav

Notice the missing "My music" directory ;-)

Command:
OnDropAction=[!log "Hey you dropped the file: $Directory$ - $Name$ - $Type$, or as i like to say $File$"]

Can you advise me?
User avatar
theAzack9
Developer
Posts: 522
Joined: March 2nd, 2016, 6:23 pm

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

Post by theAzack9 »

hleen wrote:Hi,

thanks for this nice plugin!
I use it to call a batch file that resamples my hi-res wave files.
However, I noted a problem: the $Directory$ variable is not correct.

I drop the file "D:\My Documents\My Music\Pink.wav"
and the variables are:
$Directory$: D:\My Documents
$Name$: Pink
$Type$: wav
$File$: D:\My Documents\My Music\Pink.wav

Notice the missing "My music" directory ;-)

Command:
OnDropAction=[!log "Hey you dropped the file: $Directory$ - $Name$ - $Type$, or as i like to say $File$"]

Can you advise me?
I'm sorry for a bit of a late answer, i will look into this later when i have the time :)

This is probably just a small oversight on my side, but won't $File$ still work for you?
I might be wrong. If i am, please expand a bit and post some more code if possible, it makes it much easier to help ;)

Thanks for the bug report, i will fix it when i have the time! :)
hleen
Posts: 2
Joined: January 15th, 2017, 12:34 pm

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

Post by hleen »

Hi,

thanks for your attention! I now use $file$ but in my command file (which is called upon drop) I have to disassemble it because I need the path.
Code of the plugin is:

Code: Select all

[meterTitle]
Text="Sox Resample to 44 / 16"
ToolTipText="Drop hi-res wave file to resample by Sox to 44 khz / 16 bit"

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
; Example: 
; OnDropAction=[!log "Hey you dropped the file: '$Directory$' - '$Name$' - '$Type$', or as i like to say $File$"]
OnDropAction=!Execute ["D:\My Documents\Sox Resampling\Rainmeter Sox Resample to 44.cmd" "$File$"]

[Image]
Meter=Image
MeasureName=DragNDrop
SolidColor=128,128,128
PreserveAspectRatio=2

[MeterText]
Meter=String
MeterStyle=styleTextLeft
Y=#titleDefaultHeight#
LeftMouseDownAction=!Execute ["#1#"]
ToolTipText="Drop file to resample by Sox to 44 khz / 16 bit"
Text=Drop hi-res wave file here...
And the command file:

Code: Select all

@echo off
setlocal ENABLEDELAYEDEXPANSION

rem Take the cmd-line, remove all until the first parameter
set "params=!cmdcmdline:~0,-1!"
set "params=!params:*" =!"
set count=0

rem Extract path
for %%a in (!params!) do (
    set filepath=%%~dpa
)
cd %filepath%
... etc...
Last edited by jsmorley on January 29th, 2017, 2:00 pm, edited 1 time in total.
Reason: Edited to use [code] tags.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

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

Post by Mor3bane »

Hi,

This does not seem to allow the actual "drag" of any file.extension from say like the desktop to a meter that is a drive widget e.g. a meter that links to an external drive?

The gist I got from the first post is that is what is meant to be made possible.

From what I read this should work:

Code: Select all

[Drive 1]
Meter=String
SolidColor=0,0,0,1
X=60
Y=-15
H=115
W=115
StringAlign=Center
FontColor=#ColorZ#
FontSize=100
FontFace=Astronaut
Text="E"
LeftMouseUpAction=["E:\"]

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop

[Receive]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDrop
Bounds=0,0,131,131
Action=Move
But it doesn't?

What's wrong here?


Thanks :oops:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
Psychopomp
Posts: 6
Joined: January 23rd, 2017, 12:18 am

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

Post by Psychopomp »

Does anyone knows how to modify Circle Launcher so I can drop files to folders.

Code: Select all

[Rainmeter]
Update=1000
Author=http://Lybrica.deviantart.com/
@include=#@#Variables.inc

[Image]
Meter=Button
ButtonImage=pic0_button
X=0
Y=0
LeftMouseUpAction=["E:\Pictures"]

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
OnDroppedAction=
What I need to write to enable drop dragged files to "E:\Pictures"?
User avatar
theAzack9
Developer
Posts: 522
Joined: March 2nd, 2016, 6:23 pm

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

Post by theAzack9 »

Mor3bane wrote:Hi,

This does not seem to allow the actual "drag" of any file.extension from say like the desktop to a meter that is a drive widget e.g. a meter that links to an external drive?

The gist I got from the first post is that is what is meant to be made possible.

From what I read this should work:

Code: Select all

[Drive 1]
Meter=String
SolidColor=0,0,0,1
X=60
Y=-15
H=115
W=115
StringAlign=Center
FontColor=#ColorZ#
FontSize=100
FontFace=Astronaut
Text="E"
LeftMouseUpAction=["E:\"]

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop

[Receive]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDrop
Bounds=0,0,131,131
Action=Move
But it doesn't?

What's wrong here?


Thanks :oops:
Hi Mor3bane, you need to specify a path in where the file should be moved ;)

e.g

Code: Select all

[Receive]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDrop
Bounds=0,0,131,131
Action=Move
FilePath=#@#Images
If you only want to get the file path itself then you can set the Action= Path, then you won't need a Path to the end directory.

Sorry for late answer :oops:

Edit:
Seems you were right, there were some spookyness in the functions ;)
Download the latest version and apply my suggested changes and it should work fine ;)
Last edited by theAzack9 on February 5th, 2017, 11:00 pm, edited 1 time in total.
User avatar
theAzack9
Developer
Posts: 522
Joined: March 2nd, 2016, 6:23 pm

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

Post by theAzack9 »

Psychopomp wrote:Does anyone knows how to modify Circle Launcher so I can drop files to folders.

Code: Select all

[Rainmeter]
Update=1000
Author=http://Lybrica.deviantart.com/
@include=#@#Variables.inc

[Image]
Meter=Button
ButtonImage=pic0_button
X=0
Y=0
LeftMouseUpAction=["E:\Pictures"]

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
OnDroppedAction=
What I need to write to enable drop dragged files to "E:\Pictures"?
From what i understand do you want to move the files to E:\Pictures, right?

if so then you should tell the plugin to move the file dropped and give it the path to E:\Pictures

Here is a code example that should help :)

Code: Select all

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Move
Path=E:\Pictures
:thumbup:
User avatar
theAzack9
Developer
Posts: 522
Joined: March 2nd, 2016, 6:23 pm

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

Post by theAzack9 »

hleen wrote:Hi,

thanks for this nice plugin!
I use it to call a batch file that resamples my hi-res wave files.
However, I noted a problem: the $Directory$ variable is not correct.

I drop the file "D:\My Documents\My Music\Pink.wav"
and the variables are:
$Directory$: D:\My Documents
$Name$: Pink
$Type$: wav
$File$: D:\My Documents\My Music\Pink.wav

Notice the missing "My music" directory ;-)

Command:
OnDropAction=[!log "Hey you dropped the file: $Directory$ - $Name$ - $Type$, or as i like to say $File$"]

Can you advise me?
This should be fixed in version 3.0.1 :)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5414
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

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

Post by eclectic-tech »

@ theAzack9

Thanks for update and the redistribution rar package! :great:
Psychopomp
Posts: 6
Joined: January 23rd, 2017, 12:18 am

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

Post by Psychopomp »

theAzack9 wrote:From what i understand do you want to move the files to E:\Pictures, right?

if so then you should tell the plugin to move the file dropped and give it the path to E:\Pictures

Here is a code example that should help :)

Code: Select all

[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Move
Path=E:\Pictures
:thumbup:
I tried that. It doesn't work.