Outliner with drag/drop reordering - part 2
@ihf thus in terminal? I used in double clicking it in Finder
V0.02 - runs on Mac and in Pythonista on iPad/iPhone - generates a web page (without images, font attributes, links...) - opens a new tab in Safari to display the html
As I don't know a lot about html/css, I don't see how I could make this script better so the html would support images (at left/right/...), font attributes, links and so on...
I wonder if the ideal would not be that the outline program generates a .pdf each time an .outline file is "finished", either when the program is closed, or when the option "new" creates a new one,
the mac_outline_viewer program would then allow you to choose a .pdf to display.
@ihf Are you interested by viewing your outlines (text) on your Apple Watch (if you have one as I think )?
If yes, I've found a way (after hours of tests), not yet programmed but feasible.
The outline.py program could, at each save, create/update the notes field (if accessible as I hope, but not sure, see here) of a contact named as
first name = outline
last name = file name (without the yyyymmdd_hhmmss part)
You would need to run a shortcut on your Apple Watch, shortcut as:
- show a list of contacts with first name = outline
- you select one in the list
- get notes
- quick look of notes
It seems that from IOS 13, notes field of contact is no more available to apps.
Thus, my solution would not work.
I'll try to use notes fields of calendar events, for instance in a specific calendar...
Tried (not in outline.py) and ok
Concept is to store it in an area readable by Apple Watch shortcut and shared on all Idevices
@ihf please give me news about the Mac script and the Apple Watch proposal
@cvp Sorry for the delay in replying. I am away from home this week and had some network issues yesterday. I will try to test the Mac script later today. As to the watch, that would be a great addition. I think I would use DataJar for this purpose. I have to look at how Pythonista could add values though.
@ihf oups, sorry to have insisted, no urgence at all.
don't know datajar, if you find a way that Pythonista could use it to update such a file, tell me.
@ihf the only way I actually see to update the Data Jar database is via a shortcut, not via a Python script. Thus, I don't see how it could help you to store the ouTline data.
ihf last edited by ihf
@cvp Yes but you can do this:
import shortcuts shortcuts.open_shortcuts_app(name="dj",shortcut_input="Hello World"
The Shortcut looks like this: https://www.icloud.com/shortcuts/a944a4779c0c4c71861a402cb6b6a138
Then it is easy to get to Datajar values from a shortcut that is run on the watch.
@ihf Did you try it? That will say that at each save of an outline file, I should run a shortcut, passing the text part of the outline? Agree?
To be compared to update a calendar event (fixed date, title = outline name) with its notes field = outline text part. And shortcut on Apple watch can show a list of all such events, user select one and show the text.
@cvp Yes I tested saving text from Pythonista to Data Jar. However, your idea of using the calendar may turn out to perform better as it does not depend on a 3rd party app. Also, depending on the formatting, the calendar route might offer a way to see an outline on the Mac. (There is a DataJar for the Mac in beta but I have not tried it).
@ihf I guess that is possible on Mac to read calendars, but I don't know how in Python (quid about Two-factor authentication?).
But is my script on Mac not sufficient? Read the outline file is not better?
@cvp Reading the outline with Python is better although having it in the calendar as you suggested would also make it readable on the watch as well as on the Mac without any additional programs. I’m just not sure how usable it will be on the Watch given the display limitations and the inability to check off outline items. I’m happy to try it, if you implement it (either with Datajar or the calendar).
the inability to check off outline items
What do you mean? Mac and Apple Watch would only be used to read the outlines, not to update them by checking them, isn't it?
@cvp yes, I was just thinking that without any even minimal interaction capability and given the size of the display and the amount of text it can show, reading outlines on the watch may be of limited utility. But without trying it, I can’t really know for sure.
@cvp I had to change the date in the Shortcut to 1/1/2022 01:00 but it worked well…very fast on the watch.
@cvp yes, it is usable on the watch and is a good enhancement
@cvp I was trying to get someone to try out Outline and they did not have the support files. They got the message in the console that had links to the 5 or so support scripts. Could you possibly change that so that if it does not find the files, it asks if the user wants to do the download (using requests)? It could greatly simplify getting someone started with Outline.