It is currently March 28th, 2024, 9:01 am

Some help with the new InputText Plugin

Tips and Tricks from the Rainmeter Community
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Some help with the new InputText Plugin

Post by jsmorley »

The new InputText pluging by psouza4 is really slick. It opens up a lot of new possibilities.

It has a lot of settings and can be a bit daunting, so I did a sample skin that shows off some of the capabilities and has some comments in the .ini file to explain how it works.

Make sure you have Rainmeter 1.4 r642 or better, then Just run this .rmskin to install and load the sample skin:
InputTextTest.rmskin
(158.3 KiB) Downloaded 402 times
1.png
2.png
3.png
4.png
COcis
Posts: 10
Joined: May 5th, 2010, 1:42 am

Re: Some help with the new InputText Plugin

Post by COcis »

Greetings, i was checking some info about the InputText plugin, and i cannot figure out if there is a way to put the written text on a .txt file... It's possible? (maybe with a "select all" copy to txt -> macro with autokey or similar?)
Thanks for all the hard work and Best Regards!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Some help with the new InputText Plugin

Post by jsmorley »

There really is no way natively in Rainmeter. The only ability it has to "write" is with !RainmeterWriteKeyValue, which only writes Key=Value pairs to a .ini format file.

However, I knocked out a little AutoIt app that might help.

Skin showing how to use it:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureInput]
Measure=Plugin
Plugin=InputText.dll
SolidColor=8C5915FF
FontColor=FFEDD6FF
FontFace=Seqoe UI
StringStyle=Bold
FontSize=15
X=5
Y=5
H=25
W=240
DefaultValue="Enter Value"
Command1=!Execute ["#CURRENTPATH#WriteInput.exe" "#CURRENTPATH#OutputFile.txt" "Append=0" "$UserInput$"]

[MeterWriteKeyValue]
Meter=String
X=5
Y=5
H=25
W=240
FontSize=15
FontColor=255,255,255,255
SolidColor=8C5915FF
AntiAlias=1
Text=""
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 1"
So put this little app (WriteInput.exe) in the same folder with the skin, or in Addons if you desire and change the path appropriately. The source code for the AutoIt is included, so feel free to install AutoIt and change it as you like.
WriteInput.zip
(331.32 KiB) Downloaded 260 times
Notes:

Command1=!Execute ["#CURRENTPATH#WriteInput.exe" "#CURRENTPATH#OutputFile.txt" "Append=0" "$UserInput$"]

Change the path and name of the output file in: "#CURRENTPATH#OutputFile.txt"
Set it to either append to the file (1) or create a new one (0) in: "Append=0"

It must have ALL these parms, with quotes exactly as I have them, in exactly this order.

When you enter a value in the InputText field, it will be written to the designated text file.
COcis
Posts: 10
Joined: May 5th, 2010, 1:42 am

Re: Some help with the new InputText Plugin

Post by COcis »

Thx for response, i will try also your way! In the meantime i almost resolved with:

- Checking Test.Inc i discovered that the last written words after the "enter" confirmation where stored as first variable
- Then i automailed that file content as body of a mail with a autohotkey script for a configured outlook express/outlook

AutoHotKey Script:
;These first outlined are for a more manual approach
;Clipboard :=
;Click 486 383
;Click 486 383
;send ^a
;send ^c
;If (Clipboard != "")
;clipboard = %clipboard%
;ClipWait, 2
;FileAppend, %clipboard%, C:\yeah.txt

address=info@kombok.it
subject=Form Test

FileRead, body, C:\Documents and Settings\COcis\Documenti\Rainmeter\Skins\KOMBOK2011MAIL\Test.inc
;body = %clipboard%
; Compose the mailto string
msg=mailto:%address%?subject=%subject%&body=%body%

; Format the mailto command so it creates a nice message
stringreplace, msg,msg,%a_space%,`%20,all
stringreplace, msg,msg,`r`n,`%0d,all


; Run the command
run, %msg%

; Wait for the Outlook mail window to come up, identifeid by the subject line
winwaitactive, %subject%

; Time to breathe ...
;sleep, 300

; ... and send it
send, {CTRLDOWN}{ENTER}{CTRLUP}

ExitApp

;EOF --------------------------------------------------------------------------


The only problem that remains, and blocks usability is about the text input, i would like to close the input window wich remains opened even if i close the config, the only way to make it disappear is to press enter on keyboard... There is some workaround to that behaviour of the input plugin? I attach the code so you can check. To reproduce Click on input, and then close the config from taskbar rainm icon, the input windows remains.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

[Variables]
@Include=Test.inc
FontSize=14

[MeterBackground1]
Meter=Image
SolidColor=0,0,1
W=750
H=400
;X=-400
;Y=-300

[MeterBackground2]
Meter=Image
SolidColor=0,0,1
W=250
H=60



[Meter1]
;concorsi
Meter=BUTTON
X=350
Y=300
ButtonImage=C:\Documents and Settings\COcis\Documenti\Rainmeter\Skins\KOMBOK2011VIDEO\audi.png
ButtonCommand=!Execute ["SomeCommand"]
;LeftMouseDownAction=!RainmeterShowFade KOMBOK2011\VIDEO
LeftMouseUpAction=!Execute ["C:\Documents and Settings\COcis\Documenti\Rainmeter\Skins\KOMBOK2011MAIL\KMail.ahk"][!RainmeterHideMeter MeterMailOut][!RainmeterShowMeter MeterVideoIn][!RainmeterShowMeter MeterUsatoIn][!RainmeterShowMeter MeterMailIn][!RainmeterHideFade KOMBOK2011MAIL]


[MeasureInput]
Measure=Plugin
Plugin=InputText.dll
SolidColor=0,0,255
FontColor=FFFFFF
FontFace=Seqoe UI
StringStyle=Italic
FontSize=40
X=50
Y=180
H=70
W=610
DefaultValue="Inserisci la tua Email!"

;Some Command(x) examples
Command1=!RainmeterWriteKeyValue Variables FirstVar "$UserInput$" "#CURRENTPATH#Test.inc"
Command2=!RainmeterRefresh InputTextTest
Command3=!Execute [PLAY "#CURRENTPATH#TaDa.wav"]
Command4=!RainmeterRefresh
[MeterWriteKeyValue]
Meter=String
X=100
Y=180
FontSize=40
FontColor=255,255,255,255
AntiAlias=1
Text=#FirstVar#
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 1-4"


Going to try also you precious suggestions! Best Regards!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Some help with the new InputText Plugin

Post by jsmorley »

You can close the input box by hitting enter, hitting escape, or if you put FocusDismiss=1 on the measure, it will close if you click anywhere outside it. I actually was not aware it would stay open if you closed the skin... Guess I never tried pulling the rug out from under it.

HOWEVER, the only way it will accept and use what you type in is by hitting Enter. If you close it any other way, it is considered saying "never mind" and the text you type in is not used as the entire process is just aborted and the input box is closed.
COcis
Posts: 10
Joined: May 5th, 2010, 1:42 am

Re: Some help with the new InputText Plugin

Post by COcis »

Great! Thx! Probably i will add also autoit to the combo :D
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: Some help with the new InputText Plugin

Post by Scolex »

In your example what are these 2 commands that are tied together in the [MeterSetVariable] doing other than playing the wav

Command4=!RainmeterSetVariable SecondVar "$UserInput$" Y=40 DefaultValue="Change Me Too!"
Command5=!Execute [PLAY "#CURRENTPATH#DaDum.wav"]

I don't understand what Command4 is doing, where is it setting a variable.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Some help with the new InputText Plugin

Post by jsmorley »

Scolex wrote:In your example what are these 2 commands that are tied together in the [MeterSetVariable] doing other than playing the wav

Command4=!RainmeterSetVariable SecondVar "$UserInput$" Y=40 DefaultValue="Change Me Too!"
Command5=!Execute [PLAY "#CURRENTPATH#DaDum.wav"]

I don't understand what Command4 is doing, where is it setting a variable.
Sets the variable "SecondVar", which is initialized in Test.inc.
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: Some help with the new InputText Plugin

Post by Scolex »

I checked the Test.inc and it has

[Variables]
FirstVar=StringIEntered
SecondVar=!RainmeterSetVariable

This was after I entered "SetVar" in the middle entry

I assume "#CURRENTPATH#Test.inc" needs to be there somewhere but not sure where.

I was wondering if there was a difference in how it writes in the .inc which is why I was checking it out.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Some help with the new InputText Plugin

Post by jsmorley »

I use Test.inc to demonstrate writing to it with !RainmeterWriteKeyValue and setting a dynamic variable with !RainmeterSetVariable.

it's here: Command1=!RainmeterWriteKeyValue Variables FirstVar "$UserInput$" "#CURRENTPATH#Test.inc"
and here: Command4=!RainmeterSetVariable SecondVar "$UserInput$" Y=40 DefaultValue="Change Me Too!"
Post Reply