• average

    cool but this doesn't seem to work fully. this changes the creation_date but how do you change the "taken date" as if the image was taken (not edited) just now?

    import photos, dialogs
    
    asset = photos.pick_asset()
    new_date = dialogs.datetime_dialog('Set Creation Date')
    asset.creation_date = new_date
    

    posted in Pythonista read more
  • average

    How can I have a workflow hide the keyboard if the editor text is focused?

    I have a script that focuses a section and you have to put the caret in the section you want to focus. I want the keyboard to hide though.

    posted in Editorial read more
  • average

    Sometimes I update my dropbox text files remotely and want editorial to sync now. how do i get it to do this programmatically via the python editor?

    real use case is that i want editorial to hit and endpoint which will remotely modify my dropbox file and then i want to reload those changes rather than manually do it.

    posted in Editorial read more
  • average

    Can we get one like Pythonista has please?

    posted in Editorial read more
  • average

    oh interesting. I looked for this specifically on that particular page. what brings about the differences in the documentations? it makes me hesitant to use something if its documentation is suspect (possibly alluding to deprecation).

    also, how do you view the docs on the app?

    posted in Pythonista read more
  • average

    What @cvp said. Thanks again @cvp, you saved me countless hours. You must be some sort of guru I take it :)

    posted in Pythonista read more
  • average

    Update I figured it out, thanks!!

    heres what worked:

        pn=ObjCClass('CNPhoneNumber').alloc().init(stringValue='1231231234')
        lv=ObjCClass('CNLabeledValue').alloc().init(label=contacts.MAIN_PHONE, value=pn).autorelease()
        mc.phoneNumbers=[lv]
    

    posted in Pythonista read more
  • average

    thanks! that seems to work great for creating a new contact and retaining the image.

    how do I add a phone number? heres what I’m trying unsuccessfully:

    lv=ObjCClass('CNLabeledValue').alloc().init()
    lv.label='Main'
    lv.value='1113335555'
    mc.phoneNumbers=[lv]
    

    thank you!

    posted in Pythonista read more
  • average

    I've been trying to create a contact and assign it a default pic for the past hour.

    1. I use the normal contacts module to create and save a person, newPerson with basic fields and a middle name thats like "tmpId" that i use as an identifier for the next step.

    2. I use basically this code to get that person by a unique middle name identifier and set their contact image to the last taken image on the device. i reset the middle name to blank. https://github.com/tdamdouni/Pythonista/blob/master/module/contacts-module-access-profile-picture.py

    what i'm seeing is exactly the behavior i want: normal person, empty middle name, and a contact pic. however, after about 10 seconds, the contact gets modified to have the middle name set to my identifier and the contact image gone. almost like the mutations get erased. precisely what I don't want.

    data points:

    • iphone 6s latest os
    • all contacts are synced to cloud on google
    • manually editing the contact and setting the image works fine
    • latest pythonista version

    any ideas on how to just create a contact using the CNContact like in the link i shared (rather than just for the mutation step) rather than this two step process?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!