• cvp

    whaaaaaaaa

    posted in Pythonista read more
  • cvp

    My God, I've just found this , thus I wasn't the first ๐Ÿ˜‚

    posted in Pythonista read more
  • cvp

    @TPO Ho not at all, but Google is my friend ๐Ÿ˜‚

    ร‰dit: Really, I don't know what a Private API is and if it is allowed to use it. Hoping somebody will explain us.

    posted in Pythonista read more
  • cvp

    @TPO I think I've found a solution.
    The shortcut file contains as WFAppIdentifier the application BundleID, and there is a Private API to Open an app via its BundleID

    Example, this script opens the Apple Files app

    from objc_util import *
    LSApplicationWorkspace = ObjCClass('LSApplicationWorkspace').alloc()
    BundleID = 'com.apple.DocumentsApp'
    LSApplicationWorkspace.openApplicationWithBundleID_(BundleID)
    

    I've tried with net.mylifeorganized.MLO2 and it works ๐Ÿพ

    Edit: found here

    posted in Pythonista read more
  • cvp

    @TPO Sorry, before my post, I've tried some installed apps, successfully.
    And now, I've tested some other ones, like Documents of Readdle, but without success.
    Sorry for waste of time
    that would have been a good solution

    posted in Pythonista read more
  • cvp

    @TPO Just to test:

    • create a shortcut with only "Open In" with an app you don't know the url scheme
      • in my example, app is "Gaia GPS"
    • In Shortcuts app, share the shortcut "as a file"
    • import this file in your preferred editor (I import it in Pythonista and rename it as .txt)
    • you will see something like
    bplist00ร—   
    _WFWorkflowClientVersion_WFWorkflowClientRelease^WFWorkflowIcon_WFWorkflowImportQuestions_WFWorkflowActions_WFWorkflowTypes_!WFWorkflowInputContentItemClassesU754.2U2.1.3ร“
    _WFWorkflowIconStartColor_WFWorkflowIconImageData_WFWorkflowIconGlyphNumberยฝรฟ@รจwย ยกร’_WFWorkflowActionIdentifier_WFWorkflowActionParameters_is.workflow.actions.openinร’_WFOpenInAskWhenRun_WFOpenInAppIdentifier_com.trailbehind.GaiaGPS.ngยขXNCWidgetXWatchKitยฏ !"#$%&'()*+,-./0_WFAppStoreAppContentItem_WFArticleContentItem_WFContactContentItem_WFDateContentItem_WFEmailAddressContentItem_WFGenericFileContentItem_WFImageContentItem_WFiTunesProductContentItem_WFLocationContentItem_WFDCMapsLinkContentItem_WFAVAssetContentItem_WFPDFContentItem_WFPhoneNumberContentItem_WFRichTextContentItem_WFSafariWebPageContentItem_WFStringContentItem_WFURLContentItem๏ฟฝ๏ฟฝ๏ฟฝ1๏ฟฝK๏ฟฝZ๏ฟฝv๏ฟฝยŠ๏ฟฝยœ๏ฟฝร€๏ฟฝร†๏ฟฝรŒ๏ฟฝร“๏ฟฝรฎ$)*-.05RoยŒย‘ยฆยพยฟรœรŸรจรฑ 7Nb~ย™ยฎร‹รฃรฝ'BZwย๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ1๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝย 
    

    Check

    WFOpenInAppIdentifier_com.trailbehind.GaiaGPS
    

    Take the last word, and try

    webbrowser.open('GaiaGPS://')
    

    Edit: if it is ok with your app, we could of course make a little script which reads the shortcut file and extracts this last word.

    Edit: the list of apps proposed by Shortcuts "Open In" is not exhaustive at all...

    posted in Pythonista read more
  • cvp

    @TPO Shortcuts has even something better than "Open app", it is "Open In app" and you can transfer a file to this app, even to apps without url scheme.
    I have asked how they do that by a mail to the old email of the Workflow support but without any answer, as usual ๐Ÿ˜ข for Apple.

    posted in Pythonista read more
  • cvp

    You can find the script here

    Based on a @omz script

    Altough last version of Pythonista offers an easy way to add an home screen shortcut for an edited script, it still only allows as icon a standard icon.
    This script will allow to create an home screen shortcut, either for any web page, either for any Pythonista script, but, mostly, will allow user to select any image as icon:

    • a photo from camera roll
    • a local Pythonista file
    • an iCloud Drive file
    • an internet file, both an image embedded in the web page that a file to download
    1. the script sets the size of the shortcut icon in function of iDevice type, Retina or not, HD or not, Pro or not
      It is not needed to support several icon sizes in the html file because an home screen shortcut can't be shared, thus only the icon size on the device where the shortcut will run is needed.
    2. the script presents a dialog, with as fields:
      • the title of the shortcut
      • either the shortcut url if used to launch a safari webpage
        • if the user edits this field, a webbrowser is shown where the user can
          search his url, then "copy" it to the url textfield
      • either the Pythonista script to be launched
        • a switch iCloud or not will decide which files tree to show
        • a File Picker allows to select the script
      • the optional arguments in case of script to run
      • a SegmentedControl where user has to select the origin of the icon image
        • photo will show the photos picker
        • local will show a File Picker of local files
        • icloud will show a File Picker of iCloud Drive files
        • url will show a WebView where the user can search the image he wants to
          use as icon
          • then, he can drag and drop this image to a "receiving area"
        • once the image is defined, it is displayed at bottom of the dialog
        • selected item is colored to show origin of the image. It is not set as selected because, in this case, it could not be selected one more time
    3. the user tap ok when all needed fields are filled and the script will check
      their coherence while staying in the dialog
      • top of tableview is an error message label
    4. the user has still to define a square area for the icon by
      • resizing the square by touching and moving a corner
      • moving the square by touching and moving inside the square
    5. at ok, the script
      • resizes the square area to the icon size
      • converts the image into a base74 string to be integrated in the html
      • opens Safari for the standard user process of creating an home screen
        shortcut

    The script needs some non-standard modules you should put in site-packages

    • File_Picker.py, initially fom @omz, but modified to
      • be used in a TextField of a dialog
      • display thumbnails of images
      • show only selectable files (initially non selectable were grayed)
    • MyPickDocument.py to pick any file in iCloud Drive

    Given my poor knowledge of Python, it is far from perfection but I think it is usable in most cases. If it can only help one person, I would be happy.

    Oups, I'm more tired by this short description without using Google Translate than by writing the entire script ๐Ÿ˜…

    drag and drop
    icon area
    safari
    shortcut

    posted in Pythonista read more
  • cvp

    @JonB Trying to install any modules not made for pythonista is going to result in disappointment. is so true but I like your humor ๐Ÿ˜‚

    posted in Pythonista read more
  • cvp

    @shinyformica My pydrive folder is in site-packages.
    I agree that I didn't retry a new authentication ๐Ÿ˜…

    posted in Pythonista read more
  • cvp

    @shinya.ta Try

    #create normal keys
    d = 32
    dd = 4
    emojis = '๐Ÿ˜Š๐Ÿ˜œ๐Ÿ˜ฑ๐Ÿ’ฆโ˜”๏ธ๐Ÿ˜€๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜๐Ÿ˜†๐Ÿ˜…๐Ÿ˜‚๐Ÿคฃโ˜บ๏ธ๐Ÿ˜Š๐Ÿ˜‡๐Ÿ™‚๐Ÿ™ƒ๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜๐Ÿฅฐ๐Ÿ˜˜๐Ÿ˜—๐Ÿ˜™๐Ÿ˜š๐Ÿ˜‹๐Ÿ˜›๐Ÿ˜๐Ÿ˜œ๐Ÿคช๐Ÿคจ๐Ÿง๐Ÿค“๐Ÿ˜Ž๐Ÿคฉ๐Ÿฅณ๐Ÿ˜๐Ÿ˜’๐Ÿ˜ž๐Ÿ˜”๐Ÿ˜Ÿ๐Ÿ˜•๐Ÿ™โ˜น๏ธ๐Ÿ˜ฃ๐Ÿ˜–๐Ÿ˜ซ๐Ÿ˜ฉ๐Ÿฅบ๐Ÿ˜ข๐Ÿ˜ญ๐Ÿ˜ค๐Ÿ˜ ๐Ÿ˜ก๐Ÿคฌ๐Ÿคฏ๐Ÿ˜ณ๐Ÿฅต๐Ÿฅถ๐Ÿ˜ฑ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฅ๐Ÿ˜“๐Ÿค—๐Ÿค”๐Ÿคญ๐Ÿคซ๐Ÿคฅ๐Ÿ˜ถ๐Ÿ˜๐Ÿ˜‘๐Ÿ˜ฌ๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜ฎ๐Ÿ˜ฒ๐Ÿ˜ด๐Ÿคค๐Ÿ˜ช๐Ÿ˜ต๐Ÿค๐Ÿฅด๐Ÿคข๐Ÿคฎ๐Ÿคง๐Ÿ˜ท๐Ÿค’๐Ÿค•๐Ÿค‘๐Ÿค ๐Ÿ˜ˆ'
    n_emojis_in_set = 20
    n_sets = 1 + int((len(emojis)-1)/n_emojis_in_set)
    vv_array = []
    for i_set in range(0,n_sets):
        l = int(len(emojis)/n_sets)
        i = i_set * l
        set_emojis = emojis[i:i+l]
        w, h = ui.get_screen_size() 
        vv = ui.View(name='set'+str(i_set))
        vv.background_color = 'lightgray'
        h = 0
        x = dd
        y = dd
        for button_title in set_emojis:
            b = ui.Button(title=button_title)
            b_action = typeChar
            b.action=b_action
            b.frame = (x,y,d,d)
            b.font = ('.SFUIText', d)
            if (y+d+dd) > h:
                h = y + d + dd
            vv.add_subview(b)
            x = x + d + dd
            if (x+d+dd) > w:
                x = dd
                y = y + d + dd
        vv.frame = (0,0,w,h)
        vv_array.append(vv)
    
    tv.i_set = 0
    tv.n_sets = n_sets
    def nextSet(sender):
        tv.i_set = tv.i_set + 1
        if tv.i_set == tv.n_sets:
            tv.i_set = 0
        #attach our accessory to the textfield, and textview
        ww = vv_array[tv.i_set]
        tvo = tv.objc_instance
        #print(dir(tvo))
        tvo.setInputAccessoryView_(ObjCInstance(ww))
        tvo.reloadInputViews()
        
    nextSet(vv_array[n_sets-1]['nextSet'])  # display 1st set
    
    # add a button at right of "typing suggestions", just above the keyboard
    bb_target = ui.Button()
    bb_target.action = nextSet
    UIBarButtonItem = ObjCClass('UIBarButtonItem').alloc().initWithTitle_style_target_action_('Next Emojis',0,bb_target,sel('invokeAction:')).autorelease()
    #UIBarButtonItem = ObjCClass('UIBarButtonItem').alloc().initWithImage_style_target_action_(ns(ui.Image.named('emj:Bicycle').with_rendering_mode(ui.RENDERING_MODE_ORIGINAL)),0,bb_target,sel('invokeAction:')).autorelease()
    
    UIBarButtonItemGroup = ObjCClass('UIBarButtonItemGroup').alloc().initWithBarButtonItems_representativeItem_([UIBarButtonItem],None)
    
    tvo = tv.objc_instance
    tvo.inputAssistantItem().setTrailingBarButtonGroups([UIBarButtonItemGroup])
    
    v.present('sheet')
    tv.selected_range = (0,0
    

    posted in Pythonista read more
  • cvp

    @shinya.ta Sorry, I don't understand this

    It is the best if I can set this emoji to the task bar only by the operation of my wife who is visually impaired.
    
    Is Pythonisa possible to set up a button only with buttons, not in the operation of the program?
    

    If I correctly understand, you want to ask this "next set of emojis" by a normal button.
    But where do you want this button?

    posted in Pythonista read more
  • cvp

    @shinya.ta instead of

    emojis = '๐Ÿ˜Š๐Ÿ˜œ๐Ÿ˜ฑ๐Ÿ’ฆโ˜”๏ธ๐Ÿ˜€๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜๐Ÿ˜†๐Ÿ˜…๐Ÿ˜‚๐Ÿคฃโ˜บ๏ธ๐Ÿ˜Š๐Ÿ˜‡๐Ÿ™‚๐Ÿ™ƒ๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜๐Ÿฅฐ๐Ÿ˜˜๐Ÿ˜—๐Ÿ˜™๐Ÿ˜š๐Ÿ˜‹๐Ÿ˜›๐Ÿ˜๐Ÿ˜œ๐Ÿคช๐Ÿคจ๐Ÿง๐Ÿค“๐Ÿ˜Ž๐Ÿคฉ๐Ÿฅณ๐Ÿ˜๐Ÿ˜’๐Ÿ˜ž๐Ÿ˜”๐Ÿ˜Ÿ๐Ÿ˜•๐Ÿ™โ˜น๏ธ๐Ÿ˜ฃ๐Ÿ˜–๐Ÿ˜ซ๐Ÿ˜ฉ๐Ÿฅบ๐Ÿ˜ข๐Ÿ˜ญ๐Ÿ˜ค๐Ÿ˜ ๐Ÿ˜ก๐Ÿคฌ๐Ÿคฏ๐Ÿ˜ณ๐Ÿฅต๐Ÿฅถ๐Ÿ˜ฑ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฅ๐Ÿ˜“๐Ÿค—๐Ÿค”๐Ÿคญ๐Ÿคซ๐Ÿคฅ๐Ÿ˜ถ๐Ÿ˜๐Ÿ˜‘๐Ÿ˜ฌ๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜ฎ๐Ÿ˜ฒ๐Ÿ˜ด๐Ÿคค๐Ÿ˜ช๐Ÿ˜ต๐Ÿค๐Ÿฅด๐Ÿคข๐Ÿคฎ๐Ÿคง๐Ÿ˜ท๐Ÿค’๐Ÿค•๐Ÿค‘๐Ÿค ๐Ÿ˜ˆ'
    n_sets = 4
    vv_array = []
    

    Do

    emojis = '๐Ÿ˜Š๐Ÿ˜œ๐Ÿ˜ฑ๐Ÿ’ฆโ˜”๏ธ๐Ÿ˜€๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜๐Ÿ˜†๐Ÿ˜…๐Ÿ˜‚๐Ÿคฃโ˜บ๏ธ๐Ÿ˜Š๐Ÿ˜‡๐Ÿ™‚๐Ÿ™ƒ๐Ÿ˜‰๐Ÿ˜Œ๐Ÿ˜๐Ÿฅฐ๐Ÿ˜˜๐Ÿ˜—๐Ÿ˜™๐Ÿ˜š๐Ÿ˜‹๐Ÿ˜›๐Ÿ˜๐Ÿ˜œ๐Ÿคช๐Ÿคจ๐Ÿง๐Ÿค“๐Ÿ˜Ž๐Ÿคฉ๐Ÿฅณ๐Ÿ˜๐Ÿ˜’๐Ÿ˜ž๐Ÿ˜”๐Ÿ˜Ÿ๐Ÿ˜•๐Ÿ™โ˜น๏ธ๐Ÿ˜ฃ๐Ÿ˜–๐Ÿ˜ซ๐Ÿ˜ฉ๐Ÿฅบ๐Ÿ˜ข๐Ÿ˜ญ๐Ÿ˜ค๐Ÿ˜ ๐Ÿ˜ก๐Ÿคฌ๐Ÿคฏ๐Ÿ˜ณ๐Ÿฅต๐Ÿฅถ๐Ÿ˜ฑ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฅ๐Ÿ˜“๐Ÿค—๐Ÿค”๐Ÿคญ๐Ÿคซ๐Ÿคฅ๐Ÿ˜ถ๐Ÿ˜๐Ÿ˜‘๐Ÿ˜ฌ๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜ฎ๐Ÿ˜ฒ๐Ÿ˜ด๐Ÿคค๐Ÿ˜ช๐Ÿ˜ต๐Ÿค๐Ÿฅด๐Ÿคข๐Ÿคฎ๐Ÿคง๐Ÿ˜ท๐Ÿค’๐Ÿค•๐Ÿค‘๐Ÿค ๐Ÿ˜ˆ'
    n_emojis_in_set = 20
    n_sets = 1 + int((len(emojis)-1)/n_emojis_in_set)
    vv_array = []
    

    posted in Pythonista read more
  • cvp

    @FarmerPaco I use it every day, in Python 3 (I backup my Pythonista files on Google Drive).

    posted in Pythonista read more
  • cvp

    @shinya.ta please let me know if it is ok and if you want to put the "next set" button at another place

    posted in Pythonista read more
  • cvp

    @shinya.ta Hello
    The n_sets sets the number of sets
    You could set the number of emojis you want per set and then compute the number of sets

    n_emojis_in_set = 20
    n_sets = 1 + int((len(emojis)-1)/n_emojis_in_set)
    

    posted in Pythonista read more
  • cvp

    @Tower ๐Ÿ‘

    posted in Pythonista read more
  • cvp

    @Tower Not a problem of import, I think.
    Examples is a particular folder because installed by the app, thus for this one I don't know
    For iCloud, I remember there was a problem in the app version because you need a special argument
    You can try my script here

    Url = pythonista3://script&action=run&root=icloud&argv=...

    posted in Pythonista read more
  • cvp

    @Tower Thus, in which folder is your script?

    posted in Pythonista read more
  • cvp

    @Tower You have the App Store version?
    If yes, you do it correctly

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!