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.


    Search text in your scripts via help of popup menu

    Pythonista
    6
    16
    5001
    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.
    • cvp
      cvp last edited by cvp

      Little (not quick but still dirty) script to be executed once by Pythonista restart (fi in your pythonista_startup.py).

      When you tap help in the popup menu of a selected text

      After some seconds (function of your iDevice, the number and size of your scripts), you get a list of scripts containing the selected text (case insensitive)

      If you select a script, you'll get, like for Pythonista help, a small (webview) window displaying the script as an html with Python syntax highlighting, where occurrences of selected text are also highlighted (in yellow)

      If you search has also results in Pythonista help, you'll see both results in the list

      The script imports @jonB's swizzle module

      You can find this script here

      mikael stephen mieq 3 Replies Last reply Reply Quote 3
      • mikael
        mikael @cvp last edited by

        @cvp, wow! Now we know what you have been doing.

        Sort of acts like a help as well, right?

        cvp 1 Reply Last reply Reply Quote 0
        • stephen
          stephen @cvp last edited by

          @cvp

          OUTSTANDING!

          i have been missing the abilitynto lookup my own code like this from my pc IDE's i used to use for .net Thanks!

          1 Reply Last reply Reply Quote 0
          • cvp
            cvp @mikael last edited by

            @mikael said:

            Sort of acts like a help as well, right?

            Yes and no.

            It is used like an help but it does not give any help, it is only a way to scan your sources to find a text. Not sure this code would be used so. Perhaps it could be easier to have the search as a Pythonista tool. But, I've had some fun at least 😀

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

              garenteed EVERYDAY use from this guy lol

              1 Reply Last reply Reply Quote 0
              • stephen
                stephen @cvp last edited by stephen

                @cvp got a NameError when searching a local method variable by accedent
                screen shot

                EDIT:

                Well after another app restart itbstarted working again. not sure what happened .

                cvp A 2 Replies Last reply Reply Quote 0
                • cvp
                  cvp @stephen last edited by cvp

                  @stephen yes, bug....

                  def setSearchResults_(_self,_sel,_search_results):
                  	from objc_util import ObjCInstance, ns 
                  

                  Import * not allowed... ns forgotten
                  Import in def needed because script executed once but defs can be called later and import of module no more in memory

                  GitHub corrected

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

                    @cvp awesome ty! this module has already helped alot

                    cvp 1 Reply Last reply Reply Quote 0
                    • cvp
                      cvp @stephen last edited by

                      @stephen Thanks but I'd not be astonished if you meet other bug(sss) 😢

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

                        @cvp heads up sems like GitHub update did not take

                        Eh bugs happen. tells you it is doing somthing 😉

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

                          A best idea would be to add a new menu option in the popup menu for searching in sources, without doing that in the help menu.
                          But I don't know how to do that.
                          Perhaps @jonB who already did that in the past but also said that it was only for one edited tab.

                          1 Reply Last reply Reply Quote 0
                          • cvp
                            cvp @stephen last edited by

                            @stephen said:

                            GitHub update did not take

                            Strange, line 63 contains ,ns now

                            stephen 1 Reply Last reply Reply Quote 0
                            • stephen
                              stephen @cvp last edited by

                              @cvp appollagize 😅 looked at wrong line. been a day..

                              1 Reply Last reply Reply Quote 0
                              • mieq
                                mieq @cvp last edited by

                                @cvp Interesting! Thanks for sharing!

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

                                  @cvp. Helpful! Thank you.

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    asigrijenny @stephen last edited by asigrijenny

                                    Thank you for sharing this tip about searching text in your scripts with the help of the popup menu. It's really helpful to have a way to easily scan your sources and find specific text. I can definitely see how this could be really useful while working with scripts and popups.
                                    I'm going to keep this tip in mind while I'm working with popups in the https://promolayer.io online maker. It's always great to have some extra tools and techniques at your disposal to make your work more efficient and effective.
                                    Thanks again for sharing and helping out!

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