0
Answered

Where is the documentation for using the textastic:// URL scheme?

Gary V. Vaughan 11 years ago in General updated by Alexander Blach (Developer) 11 years ago 6

I'd like to edit my pythonista source files in Textastic, but I can't find the specification for the URL scheme.


If it's not there already, any plans for http://x-callback-url.com/ support?  I'd love to send files to Textastic for editing, and then have them sent back to Pythonista afterwards...

Answer

Answer
Answered

Here's the documentation for the x-callback-url actions that will be supported in Textastic 4.4:


http://www.textasticapp.com/v4/manual/x-callback-url.html

The textastic:// url scheme works like that:

  • Open a website in Safari
  • Tap on the address bar
  • Replace http:// with textastic://
  • Hit Return
  • Textastic will open and download the file at the url

You can use this feature to view the source code of a website or download arbitrary files in Textastic.

Thanks for the fast response.  I can use that to edit public files from my dropbox projects already.  Cool :)


Ultimately, instead of having to save them back manually after editing, and then reopen the edited version in the other app... I would like to be able to send my files from pythonista to textastic for editing, and get back the edited results automaticall. Something like this would be perfect:


textastic://x-callback-url/edit?x-source=Pythonista&x-success=pythonista://replace&text=<url encoded document body>&outputPath=path/to%20file.py&outputParam=argv

And textastic would make a local file to edit the body in that can be returned to pythonista constructing a callback url from the above:


pythonista://replace?path=path/to%20file.py&argv=<url encoded edited document body>

Might you consider something similar for a future version?

I put it on my todo list but need to investigate further.


Is there actually such a pythonista url handler already? I couldn't find a "replace" command in their url handler docs.

+1

Hi Alexander,


Thanks for the response.


Pythonista handles urls with user scripts, so the replace url handler would forward its arguments to the replace.py script you have written.  Actually my example is not quite right, because I don't think there's a way to pass named arguments (e.g. path), only positional arguments (with argv=...) that the receiving script interprets as it wishes.


I made a start at writing one, and then came unstuck when I realised that pushing a file to Textastic is currently a one way trip.


Cheers,

Gary

Ah, ok, I see. I thought "replace" was a functionality provided by Pythonista.

Answer
Answered

Here's the documentation for the x-callback-url actions that will be supported in Textastic 4.4:


http://www.textasticapp.com/v4/manual/x-callback-url.html