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#)$
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
Hi
Is there any way to get the weather conditions to split each word onto multiple lines?
eg. "Partly Cloudy" to display as
Partly
Cloudy
I'm trying to get the text to display on a specific image that is in my background bitmap.
Any help is much appreciated.
Are you using Rich Text or regular?
Rich text give you the option. One of the guru's here might have a different idea.
Sent from my Nexus 5 using Tapatalk
I'm trying to use regular text, as I'm setting a rotation, which I don't think Rich Text can handle.
I've tried a few different things to get the text to split across multiple lines without any success, so thought I'd see how to do it using the rich text.
It's got me completely befuddled.
Could someone point me in the right direction as to how I might achieve the text split?
Also, I've seen a number of widgets with custom icons in them. How do you embed icons from an icon pack in a widget; if at all possible. I may be mistaking the widget creation for something to do with a theme creation.
Any help is appreciated.
CPAPerseus said:
Could someone point me in the right direction as to how I might achieve the text split?
.
Click to expand...
Click to collapse
If you are cannot use rich text that limits you severely, and I'm not sure it is possible with Zooper alone. You can use tasker to do this, however. this will require some research on your part, but you can do an HTTP Get action in tasker to retrieve the weather condition for your location, and then perform a variable split to produce two variables, one for the first word of the weather condition, and a second variable for the second word. You would then send these to Zooper using the #T...# format.
So it is possible if you cannot use Rich Text objects in Zooper, it just requires more work on that back end.
For me I can only get Rich Text to wrap onto multiple lines if it is near the edge of the screen.
Use rich text. Set two lines and keep on increasing x-margin till it shows as two lines. For example to get two lines to show on my widget my margin number is 520. Text on different areas of the screen requires different x-margin.
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
hello, i am relatively new to zooper, but I'm pretty good with tasker.
I'm creating a basic notification widget, and i have it sending and updating the notification numbers just fine, but I am lazy and i don't wan't to have to copypasta the color codes/font sizes 12 times whenever i change my mind (frequently).
I have a tasker widget called" Zooper Widget Vars" pushing these commands (via the Zooper Widget Pro Variable plugin) (brackets are obviously not in the code)
configuration #TZFLG# = 50 (large size for icons)
configuration #TZFSM# = 10 (small size for numbers)
configuration #TZFLGC# = #ffffffff (color for icons)
configuration #TZFSMC# = #ff66d5da (color for numbers)
And i just press play whenever i want to send the variables to Zooper.
in zooper, in a rich text module, I have:
[s=#TZFSM#][c=#TZFSMC#]#TWHATSAPPCT#[/c][/s]
and in another Rich text module I have:
[s=#TZFLG#][c=#TZFLGC#]f[/c][/s]
#TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC#
#TWHATSAPPCT# updates just fine. Problem is, #TZFSM# and #TZFSMC# do not update the widget until #TWHATSAPPCT# changes. #TZFLG# and #TZLGC# do not change at all unless I manually change the letter icon and change it back, which is, quite frankly, a pain in the ass.
I have tried just sticking #TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC# in an RT module without the BBcode around them, and their values do print out, so I know that Zooper is actually receiving them, but its just ignoring them when they are enclosed in BBtags.
In layman's terms, the widget will not redraw with the new color and size parameters unless the content that the bbcode is modifying changes. Ive spent about 2 hours youtubing and googleing and wiki-ing, and I've decided I'm a noob and should just ask for help.
thank you so much in advance for any assistance.
(Nexus 5 with the lollipop dev preview installed)
P.S. though I think that ZW Utilities is a lovely little tool, it does not solve the lack of size updates, so please do not direct me there.
digitalgraffiti said:
hello, i am relatively new to zooper, but I'm pretty good with tasker.
I'm creating a basic notification widget, and i have it sending and updating the notification numbers just fine, but I am lazy and i don't wan't to have to copypasta the color codes/font sizes 12 times whenever i change my mind (frequently).
I have a tasker widget called" Zooper Widget Vars" pushing these commands (via the Zooper Widget Pro Variable plugin) (brackets are obviously not in the code)
configuration #TZFLG# = 50 (large size for icons)
configuration #TZFSM# = 10 (small size for numbers)
configuration #TZFLGC# = #ffffffff (color for icons)
configuration #TZFSMC# = #ff66d5da (color for numbers)
And i just press play whenever i want to send the variables to Zooper.
in zooper, in a rich text module, I have:
[s=#TZFSM#][c=#TZFSMC#]#TWHATSAPPCT#[/c][/s]
and in another Rich text module I have:
[s=#TZFLG#][c=#TZFLGC#]f[/c][/s]
#TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC#
#TWHATSAPPCT# updates just fine. Problem is, #TZFSM# and #TZFSMC# do not update the widget until #TWHATSAPPCT# changes. #TZFLG# and #TZLGC# do not change at all unless I manually change the letter icon and change it back, which is, quite frankly, a pain in the ass.
I have tried just sticking #TZFSM#,#TZFLG#,#TZLGC# and #TZFSMC# in an RT module without the BBcode around them, and their values do print out, so I know that Zooper is actually receiving them, but its just ignoring them when they are enclosed in BBtags.
In layman's terms, the widget will not redraw with the new color and size parameters unless the content that the bbcode is modifying changes. Ive spent about 2 hours youtubing and googleing and wiki-ing, and I've decided I'm a noob and should just ask for help.
thank you so much in advance for any assistance.
(Nexus 5 with the lollipop dev preview installed)
P.S. though I think that ZW Utilities is a lovely little tool, it does not solve the lack of size updates, so please do not direct me there.
Click to expand...
Click to collapse
Instead of entering the bbcode in the text field with the text did you try separating it out and entering it in the advanced parameters field.
jr67 said:
Instead of entering the bbcode in the text field with the text did you try separating it out and entering it in the advanced parameters field.
Click to expand...
Click to collapse
in the end i figured it out with putting all of the styling in the advanced params space and the content in the text area
thanks for your help!