[Verizon Samsung Galaxy S 4] sherdog16:
Let me just preface this with the fact that i'm just a user of tasker with some experience so nothing I say carries definitive truth... just my understanding of how it works. I didn't write the program I just have a pretty good understanding of how it works.

So... you're problem with automate it and what tasker will have trouble with is that these apps can't tell the difference between a foreground and a background app. So if you tell it to turn off GPS when you exit Waze it doesn't know that it's running in the background, it sees you leave Waze, so it executes what you told it to. You can get around this 2 ways in tasker. Here is what I would do:

Create 2 TASKS called High accuracy and Location Battery Saving (you can pick your own names if you want):

You do this by selecting TASKS at the top of tasker

Press the plus in the bottom right

Name the task Location High Accuracy and press the check mark

Now press the plus at the bottom middle

Select "Plugin"

Select Secure Settings (this is assuming you have system plus activated)

Press the pencil at the top right

Press "System+ Actions" which will expand a menu

Press Location mode

Drop down the menu and select high accuracy

Press the save icon at the top

Press your back key twice

----------------------------------------

Do that again now but name the task Location Battery Saving and select the mode when presented with the options

---------------------------------------

So at this point you should have 2 tasks named whatever you decided

Now we create 2 profiles to accomplish our task

Select PROFILES on the top left of tasker

Press the + sign

Select Application

All your apps should pop up and here you can select your high accuracy apps you want by scrolling through and pressing them so they highlight (In this example we're just using Waze)

Once your apps are selected press back and a menu pops up with your tasks listed. Choose Location High Accuracy here.

BOOM

You have High accuracy mode when you open Waze.

-----------------------------------------

To turn it off is where the caveat of losing GPS upon leaving Waze comes into play. You have 2 approches to work around this.

First, how I would do it:

Create another PROFILE

Press the word PROFILES

Press the + sign again

Select Time from the list

Set it for your expected waking hours or all day

First time is for start which I would put at 04:00

Click the box under Repeat:

Set for every 1 hour

Set the second time for 23:00

Press back which causes the TASKS list to pop up again

Select your Location Power Saving task

Press the task name after the green arrow which will open up the task again

Press the task which opens it up

Press the + sign to the right of the word If

Press the tag sign that appears next to the + sign

Scroll down and select Screen from the menu

Press the word Value that is sort of ghosted out

Type the word "off"

Press back 3 times which should bring you back to the main Tasker window.

---------------------------------------------

So what you have is a profile that will set your location to Battery Saver every hour if the screen is off. This is assuming one would have the screen on if they're navigating. Worst case scenario is that your high accuracy would stay on for 59 minutes after use. Nothing to worry about. And GPS will stay on when you leave your nav apps.

Cool huh?

I use this way because i've added gmail sync and greenify all apps if screen is off to the hourly profile. You can add other tasks to your hearts content by just adding them inside of the Location power saving task itself.

----------------------------------------------

The other way you could do this if the hourly Profile isn't desirable is to do this:

(Same TASKS are created already) Press the + sign to add a PROFILE

Press Event

Press Display

Select Display Off

Press back

Select your Location Power Saving task from the pop up

??????????

Profit!

-------------------------------------------------------

Now Location will return to normal when you turn your screen off

Hopefully this helped! (sorry about the poor layout, I had to get it done on lunch)

Cheers