Each day I'm trying to write what I done, what I'm happy for, what I learn and so on...
I like also book The Martian ;-)
And each entry of Mark Watney in The Martian starts from date (in Sols).
It would not work for me, but number of days from my birthday? ;-)
So I wrote small Python script which I run on Pythonista.
import time
import clipboard
import webbrowser
import console
import util
#if you want to use it put below your birthdate :-)
birthday=time.strptime("1900-01-11 7:45","%Y-%m-%d %H:%M")
now=time.time()
time_from_birth=now-time.mktime(birthday)
days_from_birth=round(time_from_birth/60/60/24,5)
today=time.strftime("%d-%m-%Y")
clipboard.set(today+"\nDay:"+str(days_from_birth))
print("Done")
util.startBundle("pro.writer")
Which is using next script (util.py):
from objc_util import *
from ctypes import *
import sys
def startBundle(bundleId):
libobjc=CDLL('/usr/lib/libobjc.dylib')
LSApplicationWorkspace=ObjCClass('LSApplicationWorkspace')
workspace=LSApplicationWorkspace.defaultWorkspace()
workspace.openApplicationWithBundleID(bundleId)
So first script is calculating number of days from my birthday.
For now it is 14531.84021 days ;-)
Next this with some additional text is copied to clipboard.
Next using method startBundle from util module it starts iA Writer :-)
My only job is to do CMD-V (on keyboard of my iPad Pro) and start to write about my day :-)
This startBundle may start any of program on iPad, only thing which we need to know is an id of application (here is instruction how to get this ID for known program).
I would really love to be able to instruct iA Writer to create new file and paste my text at beginning of it... but as for now I'm not able to do so ;-)
Similar postsbeta
Android vs iOS
OOo2GD 1.5.1 Birthday Edition ;-)
Worflow - my biggest disapotiment of iOS
Watchdog....
How to detect clickbaits?
No comments:
Post a Comment