-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_urtext_pythonista.py
More file actions
37 lines (34 loc) · 1.11 KB
/
launch_urtext_pythonista.py
File metadata and controls
37 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
from app_single_launch import AppSingleLaunch
from urtext_pythonista.urtext_pythonista import UrtextEditor
from urtext_pythonista.urtext_theme_light import urtext_theme_light
from urtext_pythonista.urtext_theme_dark import urtext_theme_dark
# Usage:
#
# 1. Move this file into the "This iPhone" folder of Pythonista 3
#
# 2. Set the `path` variable below to the location
# of your Urtext project inside of the iCloud Drive/Pythonista 3
# folder.
#
path = 'Urtext Projects/My Urtext Project' # (example)
#
# 3. For a single-step launch, using the iOS Shortcuts app,
# create a shorcut that opens the URL:
# pythonista://launch_urtext_pythonista.py?action=run
#
# This can then be added to your iOS home screen.
#
app = AppSingleLaunch("Urtext Pythonista")
if not app.is_active():
s = UrtextEditor({
'path' : os.path.join(
'/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/',
path),
'themes': [
urtext_theme_dark,
urtext_theme_light,
],
})
app.will_present(s.tv)
s.show()