Moshi, could you try this version?OutputType=Auto since there is no real way to detect if a string is UTF-8 encoded or not. So instead of auto detecting, this version requires an OutputType. Options include: ANSI, UTF8 and UTF16 (which used to be the "Unicode" option). UTF16 is the default since the default program is still "%ComSpec%" /U /C. The encoding of the OutputFile will correlate to the OutputType.
Also, I re-ordered some of the code to capture the output quicker in hopes of fixing the problem no output capture.
-Brian
This version completely eliminates
It is currently October 9th, 2024, 8:02 pm
RunCommand
-
- Developer
- Posts: 2738
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: RunCommand - WIP (0.0.0.3)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: RunCommand - WIP (0.0.0.3)
congrats! works just like it should.Brian wrote:This version completely eliminates OutputType=Auto since there is no real way to detect if a string is UTF-8 encoded or not. So instead of auto detecting, this version requires an OutputType. Options include: ANSI, UTF8 and UTF16 (which used to be the "Unicode" option). UTF16 is the default since the default program is still "%ComSpec%" /U /C. The encoding of the OutputFile will correlate to the OutputType.
i see the UTF-8 OutputFile is now encoded as "UTF-8 with BOM". so there is this control character in front. WebParser can handle this just fine. i have no idea whether Lua can deal with such files.
one thing for the distant future: recently i discovered that at least for me, that i like using the Quote plugin for local files as it is faster than the Webparser plugin. i am aware that it does not support UTF-8 of any kind. not really necessary but maybe worth a thought.
not sure about this one. it seems a little worse than before.Brian wrote:Also, I re-ordered some of the code to capture the output quicker in hopes of fixing the problem no output capture.
-
- Developer
- Posts: 22847
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RunCommand - WIP (0.0.0.3)
FYI, Lua is fine with the BOM.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: RunCommand - WIP (0.0.0.3)
is it possible to pass multiple parameters containing spaces to a batch file?
what works on the command line is:
i tried multiple variations of quotes with the Parameter option, but they all seem to fail.
maybe something like this would be nice:
what works on the command line is:
Code: Select all
mail.bat "FirstName LastName" sender@gmail.com password recipient@example.com "This is the subject" "This is the body"
maybe something like this would be nice:
Code: Select all
Program=mail.bat
Parameter=""FirstName LastName""
Parameter2=sender@gmail.com
Parameter3=password
Parameter4=recipient@example.com
Parameter5=""This is the subject""
Parameter6=""This is the body""
-
- Developer
- Posts: 2738
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: RunCommand - WIP (0.0.0.3)
It should be possible. I would probably do it like this:moshi wrote:i tried multiple variations of quotes with the Parameter option, but they all seem to fail.
Code: Select all
Program=mail.bat
Parameter=""FirstName LastName" "sender@gmail.com" "password" "recipient@example.com" "This is the subject" "This is the body""
To catch the spaces inside the parameters, you may need to edit your batch file. Normally you would have %1 to represent your parameter. You can add the "~" modifier to capture parameters with spaces. You may also need to add quotes around it as well. So %1 becomes "%~1".
Someone correct me if I am wrong as it has been a while since I have done anything like that.
-Brian
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: RunCommand - WIP (0.0.0.3)
works like a charm! thanks
did not need to edit the batch file.
actually the tilde is needed to strip the quotes
mail.bat "FirstName LastName" sender@gmail.com ...
would become
while i what i do is
to get
did not need to edit the batch file.
actually the tilde is needed to strip the quotes
mail.bat "FirstName LastName" sender@gmail.com ...
Code: Select all
echo From: %1 ^<%2^> >mail.txt
Code: Select all
From: "FirstName LastName" <sender@gmail.com>
Code: Select all
echo From: %~1 ^<%2^> >mail.txt
Code: Select all
From: FirstName LastName <sender@gmail.com>
-
- Developer
- Posts: 2738
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: RunCommand - Beta (0.0.1.0)
Version 0.0.1.0 (Beta) is now available here: http://rainmeter.net/forum/viewtopic.php?p=92974#p92974
And thanks for all the testing. I really appreciate it!
-Brian
Yeah, you are right. Its been too long since I have programmed batch files...moshi wrote:did not need to edit the batch file.
actually the tilde is needed to strip the quotes
And thanks for all the testing. I really appreciate it!
-Brian
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: RunCommand - Beta (0.0.1.0)
no problem at all. i like this plugin a lot, as it makes many things easier.
using a plugin and displaying the measure is a concept even a monkey can understand, while doing the same with several scripts and reading a redirected text output takes a lot more steps.
and i already have this skin (and a few calendars) here: works great. but it is a little scary how easy it would be to steal other people's account details.
i am just not sure whether to upload it or not. will this plugin become a part of the standard Rainmeter install? or would, if i would include the plugin, the included one overwrite an eventually already installed newer version of the plugin?
using a plugin and displaying the measure is a concept even a monkey can understand, while doing the same with several scripts and reading a redirected text output takes a lot more steps.
and i already have this skin (and a few calendars) here: works great. but it is a little scary how easy it would be to steal other people's account details.
i am just not sure whether to upload it or not. will this plugin become a part of the standard Rainmeter install? or would, if i would include the plugin, the included one overwrite an eventually already installed newer version of the plugin?
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 2738
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: RunCommand - Beta (0.0.1.0)
We don't have any concrete plans to add this plugin as part of the Rainmeter install at this time. jsmorley, poiru and I talked about it briefly almost 2 months ago and concluded that it might be best to release it separately for now to judge its use by others (especially from countries outside the US).moshi wrote:will this plugin become a part of the standard Rainmeter install?
If the plugin does make it into the standard Rainmeter installation, then that is the plugin that will always be used (no matter if a separate "3rd-party" plugin gets installed). Rainmeter always uses the plugins in the "Program Files\Plugins" folder over any 3rd party plugins located in the "%AppData%\Rainmeter\Plugins" folder (even if it is the same plugin, but a different version).moshi wrote:if i would include the plugin, the included one overwrite an eventually already installed newer version of the plugin?
If the plugin does not make it into the standard Rainmeter installation, then the plugin could get overwritten when someone installs an "older" version of the plugin. Of course the user can tell Rainmeter to not install a plugin when installing a .rmskin (they would need to uncheck the plugin checkbox) - but I doubt a regular user ever does that (or even knows about it).
This is totally up to you. Since the plugin is still a "beta", you may want to wait until a final version is done (which I think will be soon!).moshi wrote:i am just not sure whether to upload it or not.
-Brian
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: RunCommand - Beta (0.0.1.0)
yeah, that's a bad situation. can hardly be solved nicely with 32 and 64 bit versions.Brian wrote:If the plugin does not make it into the standard Rainmeter installation, then the plugin could get overwritten when someone installs an "older" version of the plugin. Of course the user can tell Rainmeter to not install a plugin when installing a .rmskin (they would need to uncheck the plugin checkbox) - but I doubt a regular user ever does that (or even knows about it).
my biggest problem with it right now is that i can not use the value of a measure with a FinishAction.
With the Webparser plugin i can do things like:
Code: Select all
[MeasureEvi]
Measure=Plugin
Plugin=Plugins\WebParser.dll
...
FinishAction=["someapplication.exe" "[MeasureEvi]"]
an OnChangeAction wont help in the scenario i have in mind, as the value (success or error) might not change, but still something new has happened.