omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Import Scripts written on Mac/PC to Pythonista?

    Pythonista
    21
    34
    53467
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DavidHutchison
      DavidHutchison @ccc last edited by

      @ccc Late finding this (checking referral logs for once), I've put the Dropbox Sync script into a repo here: https://github.com/dhutchison/PythonistaScripts . If you are able to fix the issue it would be much appreciated!

      1 Reply Last reply Reply Quote 0
      • psidnell
        psidnell last edited by

        I found a pretty simple way to import files from DropBox to Pythonista using the WorkFlow app.

        https://github.com/psidnell/Pythonista/blob/master/README.md

        1 Reply Last reply Reply Quote 0
        • Ralph432
          Ralph432 last edited by

          Sounds strange, but i was wondering about Pythonistas new script -> "import photo" option. Then i renamed my script on my mac to ".jpg" . That should open all ways to transfer the file (photo) between apps on iPhone regardless from Dropbox and Co. I sent myself an email, imported the photo into my Photo App and then created new script in Pythonista with "import photo" -> rename from jpg to py and done. Maybe someone like me stumbles over the same problem not wanting to install more apps on iphone.

          snowlock 1 Reply Last reply Reply Quote 0
          • zipit
            zipit last edited by

            You can import any file type into pythonista, you have just to press the share button in your source app, then select pythonista and then import file.

            snowlock 1 Reply Last reply Reply Quote 0
            • snowlock
              snowlock @Ralph432 last edited by

              @Ralph432 Could you post the script that you wrote to do the "import photo" & rename?

              1 Reply Last reply Reply Quote 0
              • snowlock
                snowlock @zipit last edited by

                @zipit I'm clearly missing something. I emailed a Python script to myself, hit 'download', then 'share', then 'run Pythonista script' ... but none of the options say anything like 'import' or 'save' - or even 'run' for that matter. I see icons for "All Scripts', 'Scratchpad' and 'Console', but none of them appear to lead me to a place where i can import my script to Pythonista.

                1 Reply Last reply Reply Quote 0
                • ccc
                  ccc last edited by ccc

                  Filenames that end in .py are treated differently than all other files to be compliant with Apple's app review guidelines which put constraints on executable code. The workaround is to rename your file my_file.p (removing the y) on your Mac before emailing it and then on your iOS device, add the y back onto the end of the filename.

                  1 Reply Last reply Reply Quote 1
                  • JWM
                    JWM last edited by

                    The simplest solution would be to copy and paste the code as text. The way I do it is as follows...

                    1. Copy/paste your Python script in rich text format or some other text format that retains formatting and save it to Dropbox.

                    2. Send the file to the Pages app (and allow it to convert it to Pages format if necessary).

                    3. In Pages, select all and copy the text.

                    4. In a blank script in Pythonista, paste the text. This text should run as a script.

                    I also find it rather stupid that Apple would block importing .py files given you can create any sort of code on your own iOS device and even, with some rigmarole, import scripts via text copy and paste. Not cool, Apple, lol.

                    1 Reply Last reply Reply Quote 0
                    • zrzka
                      zrzka last edited by

                      Pretty complicated. The simplest solution is:

                      • Copy script on Mac to clipboard (Cmd C)
                      • Open Pythonista
                      • Create empty script
                      • Hit Cmd V (if you have external keyboard) or tap and select Paste if not

                      Read macOS Sierra: Copy and paste across devices. Apple doesn't check clipboard content, you can copy & paste Python code. Works pretty well and I use it several times a week.

                      1 Reply Last reply Reply Quote 0
                      • Brun0oO
                        Brun0oO last edited by

                        You can also use the free iOS app CloudClip with its Mac OS companion CloudClip Manager : http://www.thinkbitz.com/cloudclip/
                        It's like the macOS Sierra functionality 'Copy and paste across iOS and Mac OS devices' but this can be done on an older version of Mac OS.

                        1 Reply Last reply Reply Quote 0
                        • Rossi the Hutt
                          Rossi the Hutt last edited by

                          1. Save your script in your iCloud Drive on your Mac (I am sure Google Drive/One Drive works similarly).
                          2. Find the script using the Files (iOS 11) app on your iPad and open it. Hold your finger down to highlight the first word and drag down to the bottom to highlight the whole script. Copy.
                          3. Open the Pythonista app. Open a new script in Pythonista and hit the little clip board button to paste.
                          1 Reply Last reply Reply Quote 0
                          • Phuket2
                            Phuket2 last edited by

                            The latest beta of Pythonista includes iCloud Support. So this issue will go away if you have iCloud. I have no idea of the timeline for this beta to get into the App Store. I dont understand the internals of it, but it does work like a connected drive. So no copy and paste required. I run scripts directly from iCloud. But I suspect, under the hood there is a sync happening and that the files are local. I am just guessing. But the main point is that it just works. But look its still beta, there are some things to work out.
                            I hope I am not doing the wrong thing by posting info on beta program stuff. Especially as I have no idea of the timeline it will make it into the AppStore version. But its super cool and worth the wait. Its a game changer in my view. But have to be mindful, takes time to test these things and get them approved etc...

                            1 Reply Last reply Reply Quote 0
                            • AlinMechenici
                              AlinMechenici last edited by

                              Hi there! Sorry for the off topic, but where can I subscribe for the beta version? Thanks in advance!

                              Phuket2 1 Reply Last reply Reply Quote 0
                              • Phuket2
                                Phuket2 @AlinMechenici last edited by

                                @AlinMechenici , sorry I can open this in Twitter as I stopped using it. But I think the below link will work for you
                                https://twitter.com/olemoritz/status/700770989114667009?lang=en

                                1 Reply Last reply Reply Quote 1
                                • First post
                                  Last post
                                Powered by NodeBB Forums | Contributors