recent auto tools plugins broken

Post your questions and help other users.

Moderator: Martin

Post Reply
newturn
Posts: 30
Joined: 20 Apr 2016 08:36

recent auto tools plugins broken

Post by newturn » 15 Sep 2016 10:59

hi Martin,

i am wondering no one noticed this yet.

It seems all new auto tools plugins are broken, since they use json with curved clips { and quotes " for formatting. Thus no configuration text made by the plugin will be replaced through automagic and associated variables. I am only able to use normal text and no automagic variables :(

Martin, can you fix this somehow??

thank you in advance!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: recent auto tools plugins broken

Post by Martin » 16 Sep 2016 19:01

Hi,

Can you give an example of an Auto tools plugin that broke?
Maybe you can also use string concatenation to replace parts within the text, e.g. putString("xyz", '{"abc":'+variable+'}') or something similar.

Regards,
Martin

newturn
Posts: 30
Joined: 20 Apr 2016 08:36

Re: recent auto tools plugins broken

Post by newturn » 16 Sep 2016 19:35

Glad you replied.

Please see screenshot. I don't think concenation is a option. After changing plugin settings you would have to redo it. Also please keep in mind this doesn't only effect the auto tool plugin.
Attachments
Screenshot_2016-09-16-21-32-44.png
Screenshot_2016-09-16-21-32-44.png (207.42 KiB) Viewed 12484 times

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: recent auto tools plugins broken

Post by Martin » 16 Sep 2016 20:23

Hi,

I also found one that uses JSON...
For the moment you have to use string concatenation to replace the variables. There's probably not going to be a much better way in the short term. I could try to detect when the format is JSON and then use another way to replace the variables, however this is quite complicated and probably fails in some cases.

Example to use string concatenation:

Original:

Code: Select all

putString("parameters", '{"advancedSettings":{"deviceName":"{variable}","sendCustomMessage":false}}');
New:

Code: Select all

putString("parameters", '{"advancedSettings":{"deviceName":"' + variable + '","sendCustomMessage":false}}');
Alternatively, you can break the string into multiple parts. The parts with variable replacements have to be wrapped in double quotes:

Code: Select all

putString("parameters", '{"advancedSettings":{"deviceName":"' + "{variable}" + '","sendCustomMessage":false}}');
I find it quite interesting that the author of the auto-tools has decided to switch to this JSON-approach, since the plugin itself will break quite easily in all automation tools when the replaced text contains a value that looks like JSON or when it just contains double quotes etc.

Assume that variable contains the value abc"123. Automagic will replace the variable and will pass the plugin following text:

Code: Select all

{"advancedSettings":{"deviceName":"abc"123","sendCustomMessage":false}}
That's not valid JSON anymore so the plugin can not even parse the JSON value.

Maybe the author of the plugin is not aware about this issue :?
I'll try to contact the developer of the plugins...

Regards,
Martin

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: recent auto tools plugins broken

Post by Martin » 20 Sep 2016 19:37

The author of the auto-plugins was aware about the mentioned issue but implemented a workaround that only works with the Tasker variable syntax (%variable).

Please check the latest EAP version. It contains a new way to replace variables in case the plugin uses JSON for the values so the Auto-plugins and Automagic should be compatible again (I've just tested with the app Join).
Automagic will take care of properly escaping the values passed to the JSON so the auto-plugins should just start to work after the plugin was configured the next time in Automagic.

Regards,
Martin

newturn
Posts: 30
Joined: 20 Apr 2016 08:36

Re: recent auto tools plugins broken

Post by newturn » 20 Sep 2016 19:38

martin,

sorry that i didn't come around to answer.

Just short: THANK YOU!!!

I will try it later when i am again at home with a little bit of free time :)

best regards

Post Reply