Setting not supported by Tweak

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
c0thirty
Posts: 21
Joined: 27 Oct 2021 14:28

Setting not supported by Tweak

Post by c0thirty »

Hello, I'm trying to create a button that will toggle the "Apply to files only" option for visual filters. I found a forum thread suggesting the Tweak function and tried that after looking up the setting in the ini:
::tweak("VFApplyToFilesOnly", "");
but I get "Key 'VFApplyToFilesOnly' is not supported by Tweak." I checked the scripting reference and found the setting and settingp commands but those don't seem to work either.
::settingp("VFApplyToFilesOnly", 1);
"vfapplytofilesonly" is not a known parameter of command "settingp".

I'm curious why every setting can't be changed by the tweak command? Later on I'd also like to make a script to toggle multiple settings at once, for example, simultaneously turning off thumbnail captions, reducing the padding to 0, and setting the style to Plain, and clicking again to enable caption, set padding to 2, and set the style to Frame with Shadow. Is such a thing possible?

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Setting not supported by Tweak

Post by highend »

1. viewtopic.php?p=120052#p120052
Supported keys

2. The same, setting / settingp support the listed names in that help file entry

Use thumbsconf / setkey for everything else
Is such a thing possible
Sure but you are aware that this will require a XY restart (for things that would require setkey)?
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Setting not supported by Tweak

Post by klownboy »

Only certain tweaks can be changed on the fly and the same with SC setting. Refer to viewtopic.php?p=120052#p120052 for the undocumented tweak command and refer to the Help > Scripting Commands Reference for information on SC setting.

Refer to the Help > Scripting Commands Reference for information on SC thumbsconf. You can change these thumbnail related settings on the fly with thumbsconf([settings="ShowCaption,ZoomToFill,Style,Padding"], [separator=","]).

I see highend beat me to it. :)
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

c0thirty
Posts: 21
Joined: 27 Oct 2021 14:28

Re: Setting not supported by Tweak

Post by c0thirty »

Thanks fellows, here's what I ended up with. The thumbnail toggle works great, but the toggle apply to files feels a little clunky, and seems to open duplicate windows rather than purely restarting sometimes. Is there a better way to handle it?

Code: Select all

"Toggle Thumbnail Captions"
	$tc = thumbsconf();
	$tcShowCaption = gettoken($tc, 1, ",");
	if ($tcShowCaption == 1) {
		thumbsconf("0,1,3,2");
	} else {
		thumbsconf("1,1,4,2");
	}

"Toggle Apply to Files"
	savesettings;
	$a = getkey("VFApplyToFilesOnly", "General");
	if ($a == 1) {
		setkey(0, "VFApplyToFilesOnly", "General");
	} else {
		setkey(1, "VFApplyToFilesOnly", "General");
	}
	exit "nr";

Post Reply