InstantX toggle unit not picking up custom ON and OFF labels

James Sentman james at sentman.com
Sun Nov 2 13:54:18 EST 2014


It doesn't pick up on them because for some reason I didn't like the way it displayed and went back to the canned values :) Can't remember why, X2Web started on CLASSIC mac os, it's been a long time! 

I would create a new Units! template to work with that displays the labels so that you can still use the old one where ON and OFF are appropriate. So first I'd find the "toggle.x10" file inside the units folder inside the modules folder. Then duplicate it and give it a new name like togglewlabel.x10 and use that name to insert it into the configuration.

Then if you open the togglewithlabel.x10 file you'll see that the ON and OFF are hardcoded in there. Since this will run all the same scripts as the standard one you can just replace it with the tag that I"m already checking for. Try replacing BOTH the ON and OFF text with "[valuedisplay]" and see if that just works. It may be necessary to get both the on and off values and replace them separately if that doesn't work that would require changing some applescript though. Try this first and let me know what happens.



> On Nov 2, 2014, at 12:21 PM, Rob Lewis <rob at whidbey.com> wrote:
> 
> If I make a script that says this: 
> 
> 	tell application “X2Web” to set myUnitRecord to GetUnitRecord “Module Name”
> 
> the returned record shows the correct values for xtOnLabel, xtOffLabel, and xtCurrLabel. 
> I wonder why InstantX isn’t getting them. 
> 
> 
> On Nov 1, 2014, at 10:28 AM, Rob Lewis <rob at whidbey.com> wrote:
> 
>> James: 
>> 
>> I’ve defined ON and OFF labels for a unit, but when the “toggle” module displays the unit, it just uses “On” and “Off”. 
>> 
>> I see in units.scpt where you are trying to pick up the custom label value: 
>> 
>> 		ReplacePageTag {{"calculatedwidth", MyColumnWidth}, {"togglewidth", ToggleWidth}, {"thumbwidth", ThumbWidth}, {"background", background}, {"name", DisplayName}, {"unitid", TheID}, {"valuedisplay", TheLabel}, {"toggled", TheToggle}}
>> 
>> with “valuedisplay”
>> 
>> but it doesn’t seem to be working.
>> 
>> Any thoughts? 
>> _______________________________________________
>> XTensionList mailing list
>> XTensionList at shed.com
>> http://shed.com/mailman/listinfo/xtensionlist
> 
> _______________________________________________
> XTensionList mailing list
> XTensionList at shed.com
> http://shed.com/mailman/listinfo/xtensionlist

Thanks,
 	James


James Sentman                       http://sentman.com		http://MacHomeAutomation.com





More information about the XTensionList mailing list