Page 2 of 2
Re: Script to toggle "main contents" font size?
Posted: 08 Aug 2013 08:59
by ghost zero
a script to toggle "main contents" font size between default size and size 14? I want to make a button to toggle it.
i was hoping that was possible. but turns out it's not. the only other ways are workarounds that aren't quite the same.
ideally, i want this as a toolbar button and i'd make a custom icon for it, etc. i'm a mousey user.
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 15:13
by ghost zero
i appreciate your efforts to solve this. but unfortunately, the possibilities at the moment are not desirable to me. here's why...
the first suggestion to use the AHK program is no good, because it requires the use of an additional program--which hinders portability and also makes things too complicated.
the second suggestion with the current XY scripting capabilities is not ideal due to the need to always poke around in a right click menu to workaround its limitations. my ideal choice is a toggle button that can always do my requested functionality with the efficiency of 1-click, without this cumbersome workflow...
TheQwerty wrote:
Note however that strictly speaking this will not toggle between the default size and 14, but rather it will increase/decrease the current size 5 times. So if you use this to toggle to large fonts and then zoom out on your own the next time you press the button it will zoom out even further.
For that reason I've given the button some right-click scripts to quickly access the normal zoom in/out buttons and also to set the state of the button without adjust the font size.
that's why i would prefer don add a script command to make my original request possible.
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 15:19
by highend
Have some fun while waiting on that to happen...
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 15:25
by TheQwerty
The limitations of the script that I mentioned back then could be eliminated by using Get('Status', 2); to retrieve the new font size.
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 15:29
by ghost zero
please unlock my other topic in which i'm officially requesting this feature...
http://www.xyplorer.com/xyfc/viewtopic. ... 644#p99644
the request is similar but different, so don't get them confused. this topic is an attempt to request a script. the other topic requests an official feature that makes the functionality universally built-in for all users, and easily tweakable via configuration.
just because i've attempted to script this function before doesn't mean i not allowed to request it as an official feature. so please unlock it since it's a valid feature request.
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 15:39
by ghost zero
TheQwerty wrote:The limitations of the script that I mentioned back then could be eliminated by using Get('Status', 2); to retrieve the new font size.
if the efficient 1-click functionality is now possible to do via scripting, can you please post an updated script? since i'm not a scripter, i wouldn't know how to edit it.
also, i still want the other official request topic to be unlocked, since it is to be discussed as an official feature instead of a script.
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 16:35
by TheQwerty
Code: Select all
"Toggle Font Size"
$minSize = 9;
$maxSize = 14;
// Determine the current font size.
Button('zoomin', 1);
Button('zoomout', 1);
$sizeRegex = '^.*?(\d*[.,]?\d+).*$';
$size = RegexReplace(Get('Status', 2), $sizeRegex, '$1');
if ($size > $minSize) {
// Zoom out until the current size is smaller.
while ($size > $minSize) {
Button('zoomout', 1);
$size = RegexReplace(Get('Status', 2), $sizeRegex, '$1');
}
} else {
// Zoom in until the current size is bigger.
while ($size < $maxSize) {
Button('zoomin', 1);
$size = RegexReplace(Get('Status', 2), $sizeRegex, '$1');
}
}
Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 17:34
by ghost zero
thanks TheQwerty. aside from the 1 second delay it takes to run, it works pretty well.

Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 20:34
by admin
ghost zero wrote:thanks TheQwerty. aside from the 1 second delay it takes to run, it works pretty well.

Hm, you are looking for it, dont' you?
ghost zero, one more "request topic to be unlocked" from you and you will have to leave.

Re: Script to toggle "main contents" font size?
Posted: 03 Feb 2014 21:30
by klownboy
That was a nice idea
TheQwerty using get('Status', 2) to obtain the current font size.

I probably wouldn't use this much unless my eye sight gets even worse.

It will go in my XY scripting techniques folder incase I want to refer or use it later. Just for kicks, I may modify it make the CTB icon changes with the font change (i.e., CTBstate & CTBicon) as you made on the previous version in this thread.
Thanks,
Ken
Edit: I meant to add that the default font size on my systems is 8.25. I say that only because I initially didn't see the min font size of "9" in the script so when it returned to the starting font it was larger than what I had initially at "9" in lieu of "8.25". All was well when I changed the value to 8.25.
Re: Script to toggle "main contents" font size?
Posted: 04 Feb 2014 06:55
by ghost zero
admin wrote:ghost zero wrote:thanks TheQwerty. aside from the 1 second delay it takes to run, it works pretty well.

Hm, you are looking for it, dont' you?
ghost zero, one more "request topic to be unlocked" from you and you will have to leave.

i don't get it. i'm not even making trouble or anything--just normal posts. what is the problem you guys have with me?
Re: Script to toggle "main contents" font size?
Posted: 04 Feb 2014 08:18
by j_c_hallgren
ghost zero wrote:please unlock my other topic in which i'm officially requesting this feature...
http://www.xyplorer.com/xyfc/viewtopic. ... 644#p99644
the request is similar but different, so don't get them confused. this topic is an attempt to request a script. the other topic requests an official feature that makes the functionality universally built-in for all users, and easily tweakable via configuration.
just because i've attempted to script this function before doesn't mean i not allowed to request it as an official feature. so please unlock it since it's a valid feature request.
I don't want to step into any of Don's territory but I'll take a guess at why your unlock request wasn't well received:
You had
this thread going which maybe wasn't getting what you felt was the perfect solution...so...you then created a Wish thread as a spin-off...BUT...you've been here long enough to know that Don will act on wishes embedded in other threads on occasion as he's not quite
that picky/precise on Wishes being ONLY in that subforum...and then that other thread got locked (which probably is appropriate given the duality of threads) and you came back here to complain...given that scenario, I think I understand why you got the reaction above, ok?
I think you should not have made that other thread because while it's true that it's a feature request, it could and was made HERE as well...had you been a rookie here, maybe the reaction would be a bit different but given you're a regular, you know not to do so, ok? I'm just trying to mediate a bit and help all calm down so nobody gets too upset.
That's what I'm percieving from reading this situation..may be wrong but suspect not.
Re: Script to toggle "main contents" font size?
Posted: 04 Feb 2014 08:25
by ghost zero
well i've been here for a long time but mainly as a poster--not a lurker. i mainly only read replies to my own topics. i'm not savvy on don's preferences on these things, so the situation is confusing.
Re: Script to toggle "main contents" font size?
Posted: 04 Feb 2014 08:38
by j_c_hallgren
ghost zero wrote:well i've been here for a long time but mainly as a poster--not a lurker. i mainly only read replies to my own topics. i'm not savvy on don's preferences on these things, so the situation is confusing.
And even wilth all the time I've been here and the amount of interaction I've had here, I also sometimes can't predict what others (like Don) will do in a given situation but I DO know that while we all try to keep things as organized as possible, sometimes things are in places that aren't exactly correct but that doesn't mean they will get ignored, ok?
The one time when I feel a separate thread is valid is when a long discussion has taken place in one thread and we want to document some of that info for new users so a clean thread is created for reference...but try to keep things in only one thread at a time, ok?
Re: Script to toggle "main contents" font size?
Posted: 05 Feb 2014 06:03
by ghost zero
ok. but having a ban threat coming from don over such a small thing, and with no prior personal communication about this from him, it is disheartening. the green mods may be forum helpers, who might not necessarily care much for the end user. but coming from don, i was expecting a much more friendly and professional customer experience.