There's a nice German tutorial on AndroidPIT (same page using Google Translate), explaining this in detail. Moreover, you might want to check with the Q&A How to check success status of opened URL in Tasker?How to check success status of opened URL in Tasker?.