Skip to content

Instantly share code, notes, and snippets.

@lewisjkl
Created January 5, 2020 05:38
Show Gist options
  • Save lewisjkl/e4f8564b853db92893ae9a528d736dd9 to your computer and use it in GitHub Desktop.
Save lewisjkl/e4f8564b853db92893ae9a528d736dd9 to your computer and use it in GitHub Desktop.
Shows how to use Scriptable to send Gists to Carbon
let url = args.urls[0]
if (!url) {
let alert = new Alert()
alert.message = "Please provide a gist url as input!"
alert.present()
} else {
let paths = url.split("/")
let gistId = paths[paths.length - 1]
let carbonUrl = "https://carbon.now.sh/" + gistId
Safari.openInApp(carbonUrl)
}
Script.complete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment