• galtenberg

    I work with around 60 files in daily workflows - I'm active in many of them in one session, surfing around, gathering notes and passages into new documents.

    I won't go into a preference for tabs, presuming that's well-trodden ground. Instead, I show the bookmark bar and frequently update bookmarks.

    Some ideas and requests:

    • An ability, possibly via workflow step, to Go Back to the last open doc
      • hopefully the position in the last couple docs could be preserved, so I don't have to constantly scroll back to where I was
    • After opening a doc, ability to enter editing mode via a keyboard shortcut
      • also to enter editing mode in workflow, after a doc is opened
    • Ability to arrow/page through a doc after opening

    • Don't have file extensions in bookmark Set Bookmark Target (I'm always deleting '.txt' off the end, to save space)

    • When holding a bookmark in the bar, don't need the Edit Bookmark / Delete Bookmark first choice - since the Edit panel already has Delete function

    Lastly a wild-card request:

    I love the Arrange side bar. But I write in short paragraphs and stanzas. Thus I've written workflows to combine those into gross-looking single lines, so I can drag elements around. (Folding hides most of the text.)

    What I'd really love is for the Arrange bar to be programmable. I want to tell the bar to split by '\n\n' (rather than the current '\n').

    For further bonus points, if would be great to long hold on the arrange bar to Copy the current selection and maybe even send to another doc. Then much of the need for doc jumping goes away.

    posted in Editorial read more
  • galtenberg

    I'm seeing a difference and possible bug in the behavior of the editor module. (using version 1.5)

    I want to read a file's contents. It works when running a basic script, but not when triggered by a button press.

    Spent awhile on this, I believe this is the simplest path to reproduce:

    1. Create two scripts, one called "ReadMe.py" and one called "RunMe.py"
    2. Put some junk text in ReadMe
    3. Open RunMe and add a UI (calling the necessary load_view and present)
    4. Create a method called open_script, using the code below
    5. Create a button
    6. Set the action of the button to be open_script
    7. Run the UI, click the button

    Code:

    from console import hud_alert
    
    def open_script(sender):
      editor.open_file('ReadMe.py')
      time.sleep(0.5) # give time for file to be loaded
      hud_alert(editor.get_path())
      hud_alert(editor.get_text())
    

    You'll see the path and first line of RunMe rather than ReadMe. Although when you close the UI, you'll be on the ReadMe script.

    But if you run the logic of open_script just on its own, not through the UI, everything works as expected.

    Please advise a workaround or correct my misunderstanding?

    Thank you for Pythonista!

    posted in Pythonista read more
  • galtenberg

    Makes complete sense, thank you.

    posted in Pythonista read more
  • galtenberg

    Brilliant, that worked, thank you!

    To perform a replace in that background file, I still have to leave the time.sleep() in (with a sleep less than 0.3 typically nothing happens)... Is there a better way to do that as well?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!