It is currently October 1st, 2022, 2:53 pm

FileChoose [Ver.1.2.0.1]

Share and get help with Plugins and Addons
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: FileChoose [Ver.1.1.0]

Post by Setsukka »

balala wrote: January 31st, 2021, 9:29 pm Now that I played a little bit with the plugin, my question is if I set the UseNewStyle=1 option, how do I set the starting folder?
With the option FileInitialDirectory.
This option is designed for file and folder. The only problem is that when UseNewStyle=0, it dont work on folder.
User avatar
balala
Rainmeter Sage
Posts: 14568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: FileChoose [Ver.1.1.0]

Post by balala »

Setsukka wrote: February 1st, 2021, 1:54 am With the option FileInitialDirectory.
This option is designed for file and folder. The only problem is that when UseNewStyle=0, it dont work on folder.
Doesn't work for me, but this is not a big problem from my point of view. Thank you once again for the great work and many congratulations for this plugin. It's great.
User avatar
ervans589
Posts: 3
Joined: August 14th, 2020, 10:20 am

Re: FileChoose [Ver.1.2.0.1]

Post by ervans589 »

Hello there! I've been using your plugin for my skins and it's been great so far! I have one little problem though. Long story short, I have a desktop skin in which the user can change a (profile) picture to one of his choice. Then, from a separate "Settings" menu they can do that using your plugin. In the Settings window, I have included an icon of the current picture. The problem is, if the image is bigger than 1000px, skin animations become really laggy and sometimes Rainmeter crashes. Is there any solution to that?
The plugin part of the code:

Code: Select all

[MeasureChoose]
Measure=Plugin
Plugin=FileChoose
UseNewType=0
GetTarget=1
CopyLink=1
AllowNonstorageFolder=1
LinkCache=#@#Cache\LinkCache\
GetIcon=1
IconCache=#@#Cache\IconCache\
IconSize=3
ReturnValue=WholePath
Command1=[!WriteKeyValue Variables UserImagePath "$Path$" "#@#Variables.inc"]#Refresh#
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: FileChoose [Ver.1.2.0.1]

Post by Setsukka »

ervans589 wrote: February 5th, 2021, 3:16 pm Hello there! I've been using your plugin for my skins and it's been great so far! I have one little problem though. Long story short, I have a desktop skin in which the user can change a (profile) picture to one of his choice. Then, from a separate "Settings" menu they can do that using your plugin. In the Settings window, I have included an icon of the current picture. The problem is, if the image is bigger than 1000px, skin animations become really laggy and sometimes Rainmeter crashes. Is there any solution to that?
The plugin part of the code:

Code: Select all

[MeasureChoose]
Measure=Plugin
Plugin=FileChoose
UseNewType=0
GetTarget=1
CopyLink=1
AllowNonstorageFolder=1
LinkCache=#@#Cache\LinkCache\
GetIcon=1
IconCache=#@#Cache\IconCache\
IconSize=3
ReturnValue=WholePath
Command1=[!WriteKeyValue Variables UserImagePath "$Path$" "#@#Variables.inc"]#Refresh#
Hello, I'm sorry for probably not getting what you mean. When you choose a image, the path of the image itself is returned, instead of the thumbnail icon. So when you choose a image that's bigger than 1000px, you are surely using the big image itself.
And I think it not a good idea to use a very large image to make an animation because it can surely be very laggy.
I'm not sure if the crash is due to my plugin and I will check it once more.
By the way, when writing a skin that owns a complicated apperance and a lot of advanced functions, I'd like to separate it into 2 ".ini" files. One holds the apperance, and the other holds the functions without any visible meter. Use OnRefreshAction and OnCloseAction to keep these skins loaded and unloaded at the same time. This way, the laggy can be eased or solved.
User avatar
ervans589
Posts: 3
Joined: August 14th, 2020, 10:20 am

Re: FileChoose [Ver.1.2.0.1]

Post by ervans589 »

Thank you for your reply,
Probably I didn't explain it correctly.

I will check your solutions as you explained and try to find a solution.
Thanks, Evans
User avatar
Jax
Posts: 100
Joined: June 7th, 2021, 11:46 am

Re: FileChoose [Ver.1.2.0.1]

Post by Jax »

Hey there! I've encountered a problem where the icon cache image saved in the cache folder is kinda broken. It can't be loaded by Chameleon plugin. Is there a way to fix this?
User avatar
Yincognito
Rainmeter Sage
Posts: 4806
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileChoose [Ver.1.2.0.1]

Post by Yincognito »

Setsukka wrote: February 10th, 2021, 9:10 amBy the way, when writing a skin that owns a complicated apperance and a lot of advanced functions, I'd like to separate it into 2 ".ini" files. One holds the apperance, and the other holds the functions without any visible meter. Use OnRefreshAction and OnCloseAction to keep these skins loaded and unloaded at the same time. This way, the laggy can be eased or solved.
Just saw this now, but isn't your main INI break-up method the same as dynamically toggling an UpdateDivider=-1 on measures / meters, in effect toggling all the CPU intensive part "on" and "off" as desired? :???:
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: FileChoose [Ver.1.1.0]

Post by death.crafter »

Setsukka wrote: February 1st, 2021, 1:54 am With the option FileInitialDirectory.
This option is designed for file and folder. The only problem is that when UseNewStyle=0, it dont work on folder.
It doesn't work actually, neither FileInitialDirectory or ImageInitialDirectory. Even with UseNewStyle=1

Edit: I had an older version. Sorry
from the Realm of Death
User avatar
rbriddickk84
Rainmeter Sage
Posts: 250
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: FileChoose [Ver.1.2.0.1]

Post by rbriddickk84 »

Greetings!

I built a skin which auto-launches series of programs with some seconds delay between. So i designed a context menu where the user can change or add-delete programs at will. I am trying to store all variables (icons, names, wholepaths) in an external .inc file.

The icons and names are working, but i encountered an error where the Path writing don't work. Log window says :
!SetVariable: Skin "Files" not found

Now i am using this line in the codes to achieve the saving method:

This is the Pref.inc file partial content:

Code: Select all

[Variables]
PrgPth1=empty
PrgNm1=none
PrgIco1=empty.png


This is the main ini file:

Code: Select all

[Variables]
@Include=Pref.inc
App1=#PrgPth1#
Pname1=#PrgNm1#
Picon1=#PrgIco1#
AppNew1=empty
NameNew1=none
IcoNew1=empty.png
Num=1

[Convert1]
Measure=String
String=#AppNew1#
;Substitute="]":"","[":""
DynamicVariables=1
OnUpdateAction=[!CommandMeasure Saver "ExecuteBatch 1"]
UpdateDivider=-1
Disabled=1

[Saver]
Measure=Plugin
Plugin=InputText
Command1=[!Log "1"][!WriteKeyValue Variables PrgPth1 [Convert1] "Pref.inc"][!WriteKeyValue Variables PrgNm1 #NameNew1# "Pref.inc"][!WriteKeyValue Variables PrgIco1 #IcoNew1# "Pref.inc"][!Refresh]
DynamicVariables=1

[DataSaveSelector]
Measure=Calc
OnUpdateAction=[!Log "Done"][!EnableMeasure Convert#Num#][!UpdateMeasure Convert#Num#]
DynamicVariables=1
UpdateDivider=-1
Disabled=1

[BtnBbrowse]
Meter=String
MeterStyle=TextStyler
ImageTint=10,110,250,255
X=19
Y=236
W=120
Text=add new app
LeftMouseUpAction=[!CommandMeasure MeasureChoose "ChooseFile #Num#"]
Group=Contecs | Visuals
DynamicVariables=1
UpdateDivider=-1

[MeasureChoose]
Measure=Plugin
Plugin=FileChoose
UseNewStyle=0
GetTarget=1
AllowNonstorageFolder=1
CopyLink=0
LinkCache=#CurrentPath#LinkCache\
GetIcon=1
IconCache=#CurrentPath#IconCache\
IconSize=0
ReturnValue=WholePath
FileInitialDirectory=
ImageInitialDirectory=#CurrentPath#IconCache\
Command1=[!SetVariable AppNew1 """$[Path]$"""][!SetVariable NameNew1 "$Name$"][!SetVariable IcoNew1 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command2=[!SetVariable AppNew2 """$[Path]$"""][!SetVariable NameNew2 "$Name$"][!SetVariable IcoNew2 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command3=[!SetVariable AppNew3 """$[Path]$"""][!SetVariable NameNew3 "$Name$"][!SetVariable IcoNew3 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command4=[!SetVariable AppNew4 """$[Path]$"""][!SetVariable NameNew4 "$Name$"][!SetVariable IcoNew4 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command5=[!SetVariable AppNew5 """$[Path]$"""][!SetVariable NameNew5 "$Name$"][!SetVariable IcoNew5 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command6=[!SetVariable AppNew6 """$[Path]$"""][!SetVariable NameNew6 "$Name$"][!SetVariable IcoNew6 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command7=[!SetVariable AppNew7 """$[Path]$"""][!SetVariable NameNew7 "$Name$"][!SetVariable IcoNew7 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command8=[!SetVariable AppNew8 """$[Path]$"""][!SetVariable NameNew8 "$Name$"][!SetVariable IcoNew8 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
Command9=[!SetVariable AppNew9 """$[Path]$"""][!SetVariable NameNew9 "$Name$"][!SetVariable IcoNew9 "$Icon$"][!UpdateMeterGroup Visuals][!Redraw][!EnableMeasure DataSaveSelector][!UpdateMeasure DataSaveSelector]
What the code does, for those who confused about the "Num" variable, i have also a sorting code section here not included, which removes all the inner "empty" variables, and rewriting the variables in the inc file starting from the beginning. :) Just ignore it :D

So basically when select a new program by browsing it, it sets all the variables and saves the icons as intended. Then it enables and updates that measure which controls which variable writer line should start. The WriteKeyValues line runs and it does saves the icon and name, but not the path.

I tried to debug this for many days struggling, i hope someone could hit me with some hint maybe, which direction should i looking. :)

Thank you for help in advance!!!
User avatar
SilverAzide
Rainmeter Sage
Posts: 2050
Joined: March 23rd, 2015, 5:26 pm

Re: FileChoose [Ver.1.2.0.1]

Post by SilverAzide »

rbriddickk84 wrote: July 25th, 2022, 5:22 pm I built a skin which auto-launches series of programs with some seconds delay between. So i designed a context menu where the user can change or add-delete programs at will. I am trying to store all variables (icons, names, wholepaths) in an external .inc file.

The icons and names are working, but i encountered an error where the Path writing don't work. Log window says :
!SetVariable: Skin "Files" not found
I didn't check your code or anything, but it sounds like you are missing some quotes around a path. For example, if your measure Convert1 is returning a file path like C:\Program Files\Some\App.exe, and you do something like:

[!WriteKeyValue Variables PrgPth1 [Convert1] "Pref.inc"]

...the error you are reporting is exactly what you'll see. Make sure you have quotes around anything that can have spaces in it. As in:

[!WriteKeyValue Variables PrgPth1 "[Convert1]" "Pref.inc"]
Gadgets Wiki GitHub More Gadgets...