Editorial Workflows

Can Open URL

unlisted workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Check if a URL can be open by iOS.

Shared by: viticci

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Generate Text ?
Text
Input
Can Open URL ?
Source Code
import workflow
import webbrowser

url_scheme = workflow.get_variable('base')

if url_scheme == None:
	url_scheme = workflow.get_input()
	
if url_scheme != None:
	check = webbrowser.can_open(url_scheme)
elif url_scheme == None:
	workflow.set_output('Stop')
	
if check == True:
	workflow.set_output('Go')
elif check == False:
	workflow.set_output('Stop')