Passing variables back and forth

114 views
Skip to first unread message

Brad Tissi

unread,
Sep 22, 2015, 3:43:47 PM9/22/15
to Android Send/Expect
A few things that I'm trying to do and struggling with a bit.

1. Passing the IP Address from Tasker
Passing the port would be great as well, but it looks like symbols aren't supported in that field.
I've tried using the variable name %IPAddress (which is defined and set in Tasker) and <?IPAddress>

2. Taking an entire query from an Expect to parse and split in Tasker.
Using a defined variable %Goals in Tasker, I'm trying to take multiple words in to manipulate. (<?Goals>.*) didn't work.

The data that I'm expecting is:

Goal: Goal1
Goal: Goal2
Goal: GoalX

For an unknown number of goals and the name (Goal1) can be different. There may be a way to do this within the plugin, but I'm more familiar with Tasker.

Thank you

David

unread,
Sep 22, 2015, 6:22:41 PM9/22/15
to Android Send/Expect
On Tuesday, September 22, 2015 at 12:43:47 PM UTC-7, Brad Tissi wrote:
A few things that I'm trying to do and struggling with a bit.

1. Passing the IP Address from Tasker
Passing the port would be great as well, but it looks like symbols aren't supported in that field.
I've tried using the variable name %IPAddress (which is defined and set in Tasker) and <?IPAddress>

Hello.  Sorry, Send/Expect doesn't support variable substitution in anything other than Send fields.   Adding this functionality has been high on my list, but has been backed behind doing a restructuring of externalized data (in Tasker and in  Send/Expect profiles) in a way that doesn't break backwards compatibility.
 

2. Taking an entire query from an Expect to parse and split in Tasker.
Using a defined variable %Goals in Tasker, I'm trying to take multiple words in to manipulate. (<?Goals>.*) didn't work.

Is the %Goals variable being populated as desired?  And this is a question about how to further break it apart in Tasker?   Or is %Goals not being populated as desired by Send/Expect? 


Brad Tissi

unread,
Sep 22, 2015, 9:41:14 PM9/22/15
to Android Send/Expect
First, thank you for the quick reply.
I definitely understand priorities and thank you for continuing to work on this project. Hopefully it will come about at some point as I'd like to make that a user-entered variable through a GUI in the future.

Goal: Goal1
Goal: Goal2
Goal: Goal3
End of goals


As for %Goals, it's currently not being populated by Send/Expect and I know that it's just an expression issue. I'm slowly learning the syntax, but would appreciate any help as well.

I can't test it on the system at the moment, but can tomorrow again. Here's where I'm going to start though:

(?s)(Goal: )<Goal(>)>

Truthfully, I have no idea what I'm doing and would be just as happy to get all of the text into one Tasker variable and deal with it there.

-------------------
Would this one return all text before "End of goals" to a variable?

(?s)<Goals>(End of goals)

David

unread,
Sep 23, 2015, 2:46:28 AM9/23/15
to android-s...@googlegroups.com
Yes.  This is just a regular expression problem at this point.  This first thing you need to do is put your expression into DOTALL mode:

(?s)

But then you can just ask for "everything" because everything only depends upon what bytes it is already looking at.  What if no bytes have been received yet?  "Everything" still matches.   So, you need to know something about what end of the data your are interesting in looks like.   Here is an example from this forum.

In your case, it will probably something look like:

(?s)^(?<Goals>.*)End of goals



Brad Tissi

unread,
Oct 1, 2015, 4:12:20 PM10/1/15
to Android Send/Expect
Thanks for keeping this going. I'm finally back in the office and can try this out some more.

Trying that string results in an error unfortunately.
Name capture group error. Invalid name.

Changing to a local variable <goals> works, but then the (?s) modifier crashes Send/Expect when testing it in Tasker.
Reply all
Reply to author
Forward
0 new messages