Page 1 of 1

What is the max length of strings in Indigo variables?

PostPosted: Fri Aug 03, 2018 11:21 am
by mundmc
I’m writing a hacky script that uses a dict stored as a long-ass string in an Indigo variable (because I haven’t started trying to write a plugin yet).

Basically, I want to store a series of URL’s for the dynamic refreshing image plugin. I was gonna keep each URL in a separate Indigo variable and rotate through, but it’s easier to just put them all in one gigantic dict.


Sent from my iPhone using Tapatalk

Re: What is the max length of strings in Indigo variables?

PostPosted: Fri Aug 03, 2018 11:42 am
by jay (support)
Big. You won't have a problem.

Re: What is the max length of strings in Indigo variables?

PostPosted: Fri Aug 03, 2018 11:47 am
by mundmc
Sweet. I won’t even make big dict jokes.

Many thanks

Re: What is the max length of strings in Indigo variables?

PostPosted: Mon Aug 13, 2018 11:27 am
by mundmc
So I’ve got a gigantic dictionary that is built and stored as a string in an Indigo variable. Trouble is- Everything worked fine in my testing (in pythonista) with a test string, but I’m getting all sort of Unicode-related errors around string and log functions now.

I have been using:
Code: Select all
 myDict = ast.literal_eval(dictSource)


... to make a dict from the string.

I guess my question:
1) Does Indigo encode text into Unicode when it’s placed in an indigo variable?
2) If so, can I just encode any data into ascii after it’s brought in from Indigo? I get I’ll probably have to do that repeatedly.


Sent from my iPhone using Tapatalk

Re: What is the max length of strings in Indigo variables?

PostPosted: Mon Aug 13, 2018 1:49 pm
by jay (support)
Use json to store the dictionary (assuming that the contents are simple types like strings, integers, etc) in your Indigo variable. That should solve the unicode issues. You can post the exact errors you're seeing and that should tell us for sure.

Indigo stores variable values as unicode, but it's likely there's somewhere else in your process that's attempting to use a str.

Re: What is the max length of strings in Indigo variables?

PostPosted: Mon Aug 13, 2018 2:03 pm
by mundmc
What if it’s arrays of strings?

Re: What is the max length of strings in Indigo variables?

PostPosted: Mon Aug 13, 2018 2:35 pm
by jay (support)
Yep, json has dictionaries and lists. Complex Python objects would be a problem but the basic collection classes are OK.

Re: What is the max length of strings in Indigo variables?

PostPosted: Mon Aug 13, 2018 2:42 pm
by mundmc
Sweet- reading up on it right now. Many thanks, Jay!


Sent from my iPhone using Tapatalk

Re: What is the max length of strings in Indigo variables?

PostPosted: Tue Aug 14, 2018 7:01 am
by mundmc
I realize I’m getting off topic, made a new entry under the Python sub-forum: Unicode strings and Indigo Variables
https://r.tapatalk.com/shareLink?share_ ... are_type=t


Sent from my iPhone using Tapatalk