- Code: Select all
Track2 = indigo.variables[142028227].value #just played Track
Artist2 = indigo.variables[918614858].value #just played Artist
Album2 = indigo.variables[374325596].value #Just played Album
RunTime = indigo.variables[118845916].value #math played time
import time
time = time.strftime("%m" "%d"" " "%I"":""%M""%p")
list ="\t\n%s \t%s \t%s \t%s \t%s" %(time, RunTime, Track2, Artist2, Album2)
with open('/Users/kitchen/SynologyDrive/MyLogs/StudioSongs.txt', 'a') as outfile:
output = list
outfile.write(output)
and here is the error message:
- Code: Select all
Script Error embedded script: 'ascii' codec can't encode character u'\xe9' in position 204: ordinal not in range(128)
Script Error Exception Traceback (most recent call shown last):
embedded script, line 29, at top level
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 204: ordinal not in range(128)
I have no doubt this is because part of the text of one of the fields I'm logging has a character that isn't a value... in this case
so half-way guessing I need to convert the text from the fields into strings as opposed to values, yes?André
I used this snipped elsewhere on another script:
- Code: Select all
time = (indigo.server.getTime().strftime('%Y-%m')) #2022-01
date_string = str(time)
so tried this:
- Code: Select all
TrackX = indigo.variables[142028227].value #just played Track
Track2 = str(TrackX)