I'm using the yahoo weather provider, and I want to rewrite all the descriptions to a max of 10 character spaces to fit my current theme. Problem I'm facing is the code being returned isn't matching up to the list found HERE.
When using #W1COND#
it returns "Scattered Thunderstorms"
but #W1CODE# returns "2"
which matches to the Hurricane code on that list from yahoo.
I do not want to use the truncate feature of rich text, because "Scattered T..." pales to "Sct TStorm" in my opinion.
Related
Firstly, I *love* ZWP and have been using it religiously.
With my new Nexus 5, however, I decided to make a new widget to match the current phone instead of my previous setup. I like having my next 3-4 calendar appointments shown in a list with dates and times and the heading, in the #C0SEEE dd - HH:mm# #C0TITLE# format. Some appointments though have longer titles and interfere with other items I have entered into the widget.
I tried using the new Rich Text feature and setting margins to various lengths and setting lines to 1, but a long appointment title still bleeds over into the next portion of my layout.
What am I missing?
Zanthany said:
Firstly, I *love* ZWP and have been using it religiously.
With my new Nexus 5, however, I decided to make a new widget to match the current phone instead of my previous setup. I like having my next 3-4 calendar appointments shown in a list with dates and times and the heading, in the #C0SEEE dd - HH:mm# #C0TITLE# format. Some appointments though have longer titles and interfere with other items I have entered into the widget.
I tried using the new Rich Text feature and setting margins to various lengths and setting lines to 1, but a long appointment title still bleeds over into the next portion of my layout.
What am I missing?
Click to expand...
Click to collapse
You should consider using the [tr]-tags to limit your field to a certain amount of characters. Usage example in your case would be
Code:
#C0SEEE dd - HH:mm# [tr=30]#C0TITLE#[/tr]
This would limit the output of the title to 30 characters and put three dots at the end to indicate the string is longer than what is displayed. You'll have to play around a bit to find the right limit for your particular setup though.
For future references, you can find all the available tags for Rich Text Modules here.
Hope this helps you out
I want to do something like the following
Code:
IF condition=true THEN display '$'
But since the $ sign is used as a boundary for a conditional statement in Zooper, how do I trigger an escape so that Zooper sees my $ as a literal character? I tried '\' but it doesn't seem to be the escape character. (It does display the dollar sign, but as an error i.e. bad IF statement.)
Any ideas?
Backslash works for me. Post your code so we could have a look. [emoji4]
CopKiller76 said:
Backslash works for me. Post your code so we could have a look. [emoji4]
Click to expand...
Click to collapse
I won't use my actual code because it would be a long story explaining, but here is an example:
Code:
$#WCCODE#=16?Yay \$\$\$:Boo \$$
I expect the output to be
Yay $$$
or
Boo $
depending on the weather condition.
Instead I get
$
This is not a literal $; this is Zooper telling you that your conditional statement is faulty.
And if I have another IF statement following the above,
Code:
$#WCCODE#=16?Yay \$\$\$:Boo \$$ $WCTEMPN>=30?[c=#ffaa00]WCTEMPN°[/c]:WCTEMPN°$
I still get a solitary
$
because the entire line was already messed up from the first \$.
If you use Tasker, you could try setting up a task that sets 2 zopper variables to what you want
#TYay# = $$$ and #TBoo# = $
then use those variables in your code
$ #WCCODE#=16 ? Yay #TYay# : Boo #TBoo# $
Haven't tried this myself so I'm not absolutely sure this will work but I don't see any reason why it wouldn't. Other than this I don't see any other way to do what you want.
DIsplaying Escape / Literal Characters in Zooper using Tasker
I came upon an answer to a quandary that's been dogging me lately, and that is how to visibly show some reserved special characters in Zooper that are used in Zooper's logic equations, and then I realized how simple it is.
So for those somewhat unfamiliar with Zooper, it's a widget app that can display just about anything using dynamic variables and conditions (Time, Weather, Images), it's really versatile, and what makes it more versatile is that any condition(s) Zooper doesn't have built in variables for, Tasker can push new vars into it, to create amazing dynamic widgets.
Anyhow, Zooper uses some rather arcane logic statement setups and variable designation schemes that makes it hard to display special reserved chars such as $ , : , ? especially while operating INSIDE of a Zooper logic statement,
So a typical Zooper logic statement looks like:
$#VAR1#=1?#WEATHER#:#TIME$
Which translated to:
IF <VAR1> EQUALS 1 THEN - DISPLAY <WEATHER> ELSE DISPLAY <TIME?
So if you want to actually DISPLAY a reserved char like $, :, ? - I have yet to find the syntax to escape chars in Zooper. The typical backslash doesn't work, nor does encapsulating the char in quotes, etc. The only way I've found is to close the logic statement then open a new one and it makes a big mess.
SO SOLUTION:
In Tasker, I just used the Zooper Widget plugin to push these chars into Zooper as external variables, i.e. in a Tasker Task use the Zooper Action to:
Set var #TC#=:
Set var #TQ#=?
Set var #TD#=$
Then I just throw them in anywhere I need them in Zooper. Works like a charm and beyond that an added benefit is that Zooper seems to retain any variables set in this manner indefinitely, even after reboot, etc.
So once that Task is run in Tasker, Zooper holds on to those variables. Hopefully this is helpful, and if anyone actually knows the standard syntax (if there is one) to escape chars within Zooper without using Tasker I'd be interested.
I'm trying to use tasker to alter the font for some items. I have a popup widget that has email, gmail, sms, phone,etc. on it that I want to change font color and become bold when I have a missed call or new message. I've set up tasks and profiles for sms, and gmail so they will change color. I cannot seem to get them to become bold though. They are made as Rich Text if that matters. I can't figure out how to write the parameter where the [c][/c] and take effect together. Can somebody tell me how to write the advanced parameter to get this to work?
Also, I can't seem to figure out the code to use for email or phone. I've tried %COUNTEMAIL, %COUNTMSG, %MISSEDCALL but they don't seem to work. This is the tutorial I used for this: https://seo-michael.co.uk/change-text-colour-in-zooper-widget-with-tasker (sorry can't post a link yet). Can I make this work with the Email App and the Phone?
Thanks!
From what I've read you are trying to display a count rather than the actual text/phonecall details? In which case you would be better off using Zooper's built in variables #SMCALLS# for missed calls and so on. To change the colour of the font in rich text format you can use a conditional like this:
[c=$#SMCALLS#>0?#ffff0000:#ff00ff00$]#SMCALLS#[/c]
This will display missed call count in red when you have missed calls and green when you don't.
Then to change to bold for missed calls as well you can wrap the above in a conditional like this:
HTML:
$#SMCALLS#>0?[b]$[c=$#SMCALLS#>0?#ffff0000:#ff00ff00$]#SMCALLS#[/c]$#SMCALLS#>0?[/b]$
Hope this helps.
ps Sorry about the HTML tags but I don't know how to stop it from rendering the bold tags in the code instead of displaying them
Thanks. Are there built in variables for gmail, email, and sms? I'm trying that code but it doesn't seem to do anything on my phone...
Yes there are functions for sms , gmail etc. You can find them under the system heading when you enter your text.
The code I wrote should work fine. Are you entering it in the advanced parameters screen of the manual text edit screen?
I used the manual screen when I wrote it. When you enter it does nothing happen at all? Or only part of what you want?
Torgadden said:
Yes there are functions for sms , gmail etc. You can find them under the system heading when you enter your text.
The code I wrote should work fine. Are you entering it in the advanced parameters screen of the manual text edit screen?
I used the manual screen when I wrote it. When you enter it does nothing happen at all? Or only part of what you want?
Click to expand...
Click to collapse
I'm putting it into the advanced parameters because the manual text area is what is labeling the shortcut I have. It doesn't nothing when I enter it. I've written it, copy and pasted from the site, and still nothing. I can modify it and get the color I want to change but it will not turn bold.
I think that it needs to be written in the text area because the bold tags will need to go round your text in the same way they do if you use the bold function when writing a post here.
Torgadden said:
I think that it needs to be written in the text area because the bold tags will need to go round your text in the same way they do if you use the bold function when writing a post here.
Click to expand...
Click to collapse
Hmm ok. How do I write the paramater and still keep the text I have then? So for example, I have one line that says "gmail". Clicking the word opens gmail and when I have a new email it changes from white to green based on the #COUNTGMAIL task I have in Tasker. How do I write in the code in the manual field to keep the "gmail" and still make it change? I'll be playing with this shortly when I get a chance.
You can mix text in with your functions so if you just want the word Gmail displayed and for that word to change colour and bold when you have unread mail you would lay it out like this:
HTML:
$#SUG#>0?[b]$[c=$#SUG#>0?#ff00ff00:#ffffffff$]Gmail[/c]$#SUG#>0?[/b]$
So going through it one step at a time, the first conditional (between $ $) if unread gmail count is greater than 0 then write the open bold tag.
Then open the colour tag, if unread gmail count is greater than 0 then set font colour to green, otherwise colour is set to white.
Next the text you want to display is written, "Gmail" in this case but you could add other zooper variables or text if you needed.
Close the colour tag.
Finally the last conditional writes the close bold tag in the same way as for the first conditional.
Zooper will then render the text code as you needed it.
Hope this helps
Torgadden said:
You can mix text in with your functions so if you just want the word Gmail displayed and for that word to change colour and bold when you have unread mail you would lay it out like this:
HTML:
$#SUG#>0?[b]$[c=$#SUG#>0?#ff00ff00:#ffffffff$]Gmail[/c]$#SUG#>0?[/b]$
So going through it one step at a time, the first conditional (between $ $) if unread gmail count is greater than 0 then write the open bold tag.
Then open the colour tag, if unread gmail count is greater than 0 then set font colour to green, otherwise colour is set to white.
Next the text you want to display is written, "Gmail" in this case but you could add other zooper variables or text if you needed.
Close the colour tag.
Finally the last conditional writes the close bold tag in the same way as for the first conditional.
Zooper will then render the text code as you needed it.
Hope this helps
Click to expand...
Click to collapse
Thank you. That code works perfectly. If only I could get the zooper widget to update quicker.
So my next question is, do you have the parameter code for regular email? I know the #SUG# is gmail but I don't have the code for email, or phone, or sms. I think those are the only ones I need to do this. Although I would like to have the "music" line change color when poweramp is running....
If you go to edit text you will see the list of available fields. SMS counts, etc are under system. Looking at them I could have sworn that there was a regular email count but I can't see it now, you should be able to capture that in Tasked and pass it to zooper as a variable though.
As for the media, use Media Utilities to get the player state. It gives you a whole set of variables which will let you work with media states in Zooper
Hey, all. First of all, love Zooper and think it's amazing. I'm just starting off with advanced fields and conditionals and have had mixed results. I've searched around for some answers and experimented on my own, but have not been able to produce a successful result with one of my rich text fields.
Essentially what I'm doing is a if then statement for colors for SMS and e-mails (as demonstrated in many great tutorials) and have had success with one, but not another.
My successful conditional reads: $#SUSMS#<1? : #SUSMS#$ I.E. if the unread SMS count is less then 1, display an emoji, if greater, display the unread SMS count.
However, when I extend this to my Gmail formula I run into a problem. Because my I want my unread Gmail to read an accurate count across my default inbox (primary, promotions, updates) I use the math conditional $(#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$ which works wonderfully by itself, for example (3+5+1) = 9 and the output reads 9.
But when I try to throw that into a similar statement as above, like $ $(#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$<1? : (#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$ $ the output displays the math formula twice (3+5+1) (3+5+1), rather than the the desired result of 9 or an emoji.
Basically, I'm trying to find how accomplish the desired effect of my SMS conditional, but the addition of this math conditional is giving me problems and I cannot find the correct solution. Any tips or advice?
You don't need the extra $s around the math expressions because it's already surrounded by $s since its embedded in a conditional statement:
This should work:
$(#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)<1? emoji : (#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$
I'm using a Rich Text module and code [no]#C0Sdd#[/no] to display the correct date and number ordinals for a Calendar event. However, despite using 'dd' in the code, the Zooper widget entry is still displaying the date without a leading zero (I.e. 3rd Oct instead of 03rd Oct.).
This is making the events/agenda widget display look mis-aligned and I want it neat!
What am I doing wrong please, and is there anyway to force the leading zero to display on the date entry?
Many thanks.
Solution found elsewhere: $#C0Sdd#<10?0[no]#C0Sdd#[/no]:[no]#C0Sdd#[/no]$