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.
Outliner with drag/drop reordering
-
@ihf said:
add a text or other snippet to an outline.
In this case, outline is a file or a line of a file?
specific outline which we could call “snippets”
In this case, outline is a file or a line of a file?
-
Version V00.90 - support parametrization of supported keys combinations of external keyboard - use keyboard button in settings window - gray actions have a configured keys combination - swipe left an action and confirm 'disable' to remove it from configured combinations - associating the same combination for two actions is not allowed, when you try, the selected modifier/key will blink before to be unselected - supported actions (until now): - promote (cursor has to be on a text) - demote (cursor has to be on a text) - font attributes (cursor has to be on a text) - set due date (cursor has to be on a text) - collapse all - expand all
.
-
@cvp of course, you are absolutely right and you can use copy and paste in lieu of the share sheet. The difference is whether you stay in the application that has the text or image rather than doing a copy and going to Pythonista, starting the script and adding it to a particular outline.
-
@ihf you can copy in an app and paste in Pythonista, they share the same clipboard.
You said:
add a text or other snippet to an outline.
In this case, outline is a file or a line of a file?
You said:
specific outline which we could call “snippets”
In this case, outline is a file or a line of a file?
-
@cvp Let me try again. I was thinking that if one wanted to add a line (an item) to an outline, you could select something in any app and go to the share sheet, select (let's call it) the Outline option (which might be a Shortcut) and this would add the item to a Pythonista outline file. The only difference between this and using copy/paste is that you don't explicitly start the Pythonista app, select the outline script, select the desired outline, and paste the copy there. In the end it may not be much of a savings.
-
@ihf said:
I was thinking that if one wanted to add a line (an item) to an outline, you could select something in any app and go to the share sheet, select (let's call it) the Outline option (which might be a Shortcut) and this would add the item to a Pythonista outline file. The only difference between this and using copy/paste is that you don't explicitly start the Pythonista app, select the outline script, select the desired outline, and paste the copy there
First of all, thanks for your patience.
As you know, to share directly to Outline.py should be impossible because the script is too big to run in appex mode. Thus, as you propose, you could share a text from another app to a shortcut of which actions would be:
- get the shared text
- put it in the clipboard
- run Pythonista script with a specific outline file as argument 1 and a flag "use clipboard" as argument 2 ( or argument 2 could be the text it-self, but don't forget you also asked in the past that argument 2 could be a path where to find the argument 1 file in another path than the current. This request is still in my long todo list).
The outline script could:
- identify it is run with argument 2 "use clipboard"
- get text from clipboard
- add this text as new line at end of file of argument 1
- or you could use the standard paste when editing any line in any file, not only the last line in a fixed file.
Of course, if you always want to add the text at the end of the file, and you don't want to edit the file just after, I could write a little script to perform this little process in appex mode. And you could share directly (without passing via a shortcut) to it if you add it in the share list of Pythonista
I could even foresee that you use outline.py it-self as script to get shared text, without defining by advance which file to open, to avoid a lot of configured entries, and display a list of all outlines where you select the file that you want to appendI wait for your decision on what solution you prefer
-
@cvp Given the time it takes to start Pythonista and the script (not to mention the frequency of Pythonista crashes), I think your idea of having a simple script that only adds the item to an outline which is then edited later using Outline is fine. Typically all I want to do is to store the clip so I don't forget it. I can of course do this now with several other notebook apps but then I still have the step of getting the items into Outline. Having a (relatively) fast way of getting the item into Outline is a good compromise.
-
@ihf said:
Given the time it takes to start Pythonista and the script
Not in appex mode...because even if I use the view class, I do not present it. But use it allows to access to its methods
script that only adds the item to an outline
Do you prefer to pass the outline file name as argument or to choose the outline in a list?
-
- support run in appex mode as share of text to add at end of an outline 1st argument needs to be an outline file - support search files containing specified text - new button in Files menu - entering text - search files containing text in current path - shows a list of files - open selected file - correction of bug "keyboard icon was erroneously forced as a square" - correction of bug "setting '1st level has outline' switch did not work on iPad"
I finally decided to use original Pythonista to process the share. It runs in a fraction of second as well as Pythonista is running or not.
I hope feedback for both new functionalities.
Advice: for testing share, take a backup of the outline file you want to append to.😅You have to configure a Pythonista running share for each file you want to append.
Or, I could change to show a list of outlines files where you would have to select one to append.
.
.
.
.
-
@cvp I just tried the news file search. It worked fine. After selecting the file, might be nice to have it do the search within the file as if you had used the magnifying glass on the open file. Also, I notice that the te t box for the magnifying glass search (not the new file search) is cutoff at the top by the menu bar (on iPad in Landscape mode).
Will now test the new Share extension. -
@cvp I hope I did this correctly. I created the Shortcut within Pythonista to save to ToDo, selected some text in Safari, hit share, Run Pythonista Script, selected the new Shortcut, and nothing seemed to happen (confirmed when I looked at the outline). Did it several more times after restartingg Pythonista (just in case). Now I am getting:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 5940, in <module> main() File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 5878, in main os.remove(path + file) TypeError: remove() takes at most 0 arguments (1 given ```
-
@cvp Also, it would seem that if Pythonista is running but no script is running, if I try to do a Share, I get the error that it cannot perform the action because a script is already running. Not terrible, but not what you would like to happen.
-
@ihf said:
nothing seemed to happen
Normal, only an hud_alert of 3 seconds should appear "text pasted in ..."
-
@ihf said:
Also, it would seem that if Pythonista is running but no script is running, if I try to do a Share, I get the error that it cannot perform the action because a script is already running. Not terrible, but not what you would like to happen.
That should work even Pythonista is running but if your appex is not finished (not normal) and you retry, you could have this message: only one appex run at the time
-
@ihf said:
Now I am getting:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 5940, in <module>
main()
File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 5878, in main
os.remove(path + file)
TypeError: remove() takes at most 0 arguments (1 given ```I think it is one more time a crash of Pythonista when we run several times a script.
remove() takes at most 0 arguments Is not normal
-
@ihf could you retest without Pythonista running and check if you have the hud_alert
I don't have any problem and the file is updated, and Pythonista was running but no script
-
@cvp that was interesting. Right after I got your latest post, I tried again without Pythonista running (was sure I did that before) and got the HUD alert! However, when I then went into Pythonista, I tried to open the file that I was appending, I see 3 files with that name (differing timestamps) and opening any of them now gives:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 3710, in tableview_cell_for_row v = MyInputAccessoryView(row) File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 1075, in __init__ self.width = mv.get_screen_size()[0] # width of keyboard = screen File "/private/var/mobile/Containers/Shared/AppGroup/05D14C00-CCAC-4E98-A3CC-96C6944B8534/Pythonista3/Documents/outline.py", line 1708, in get_screen_size for window in UIApplication.sharedApplication().windows(): File "/var/containers/Bundle/Application/8778D1CF-1C08-48BA-9714-9D2CFE524EA1/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 801, in __call__ ordered_args = list(args) + [kwargs[key] for key in kwarg_order] TypeError: 'int' object is not iterable ```
-
@ihf as you can see, it is one more time a not understandable message of Pythonista crash in standard code. Was outline script running while your tests? Perhaps cross of files.
If you save the file just after the share, you could override the append. -
@cvp Now I went back to try again, and I can open any of the 3 files and each one has the appended text (1, 2 or 3 times). It is as if I had to wait (perhaps an iCloud issue) and then I have 3 copies, each with one or more of my Shared texts.
-