Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
[Share Code] Implemented x-callback-url
-
Thanks for taking the time to respond and guide, I hope you have a fun weekend. Cheers Dave
-
How do I use this and get arguments from workflow?
-
This awesome piece of code leads to the famous 404...
https://github.com/lukaskollmer/pythonista-scripts/blob/master/x-callback-url/x_callback_url.py
Someone stil has it available?
I'm trying to load a file from IAwriter to process it in phytonista...
-
-
@dc2 said:
I'm trying to load a file from IAwriter to process it in phytonista...
x-callback-url will not help you for that.
If you want to load a file into Pythonista, you have to share it to Pythonista script or to import it into Pythonista via "open external folder", if the app allows it.
-
@cvp Thanks, i think that sharing it as input in a script may be the way to go!
After trying to share the file to "Preview Markdown.py", I found that instead of the text, the path of the file is returned by appex.get_text()....
Somewhere the contents gets mixed up, probably in IAwriter...
-
-
@dc2 did you try to share to "run Pythonista script", then the standard "import file"?
-
If i open iAWriter and the file i want to share, then the "share" button, followed by "run Pythonista script" and "import file", the result is that the text file is saved into the script folder.
Not exactly what i was looking for, but from there i could probably manipulate the file and convert it to HTML in accordance with my template.
I was hoping to use the "preview markdown" example and extend that script. But as mentioned before, it only retrieves the path rather that the content.
-
@dc2 but, if you get the path, you could open a file with this path in reading mode, and thus get its content, isn't it?
-
@dc2 modify the
Preview Markdown.py
example with... def main(): path = appex.get_text() with open(path, mode='rt', encoding='utf-8') as fil: text = fil.read() converted = markdown(text) ...
I've tested with Welcome.md of Pythonista and that works, but perhaps you could have access problem with file from another app. But, if import file works, it should be ok.
-
Brilliant!
In fact opening the text file from Pythonista share didn't work and gave some type mismatch error.
The good news is that sharing from IAwriter directly worked perfectly and produced a markdown to html conversion perfectly!