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.


    How to close out scripts in Pythonista?

    Pythonista
    6
    9
    3863
    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.
    • tactfulgamer
      tactfulgamer last edited by tactfulgamer

      I almost deleted the script by swiping to the left on it, from the left side panel. Is the a way to close out the open script?

      I don’t see an x button or anything.

      Thank you!

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

        Are you on iPhone or iPad?

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

          It is sure that if you have only one edited script, there is no x button, thus no way to close it.
          You have to open another file. At least on iPad.

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

            @cvp, same on iPhone.

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

              I just figured out an alternative. Click on the [+] icon (top right) which opens a new tab, then close the file tab.

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

                possibly can setup an editor action to habdle creating z virtual temp file so you can clase all tabs then by removing thr temp file the app should default to the menu. ill look around and see if i can whip something up

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

                  @stephen you could define this little script as a Pythonista tool, it will close all tabs

                  from objc_util import *
                  
                  @on_main_thread
                  def main():
                  	win = UIApplication.sharedApplication().keyWindow()
                  	root_vc = win.rootViewController()
                  	if root_vc.isKindOfClass_(ObjCClass('PASlidingContainerViewController')):
                  		tabs_vc = root_vc.detailViewController()
                  		for tab in tabs_vc.tabViewControllers():
                  			if tab.isKindOfClass_(ObjCClass('PA2UniversalTextEditorViewController')):
                  				tabs_vc.closeTab_(tab)  
                  
                  if __name__ == '__main__':
                  	main() 
                  
                  stephen 1 Reply Last reply Reply Quote 2
                  • stephen
                    stephen @cvp last edited by stephen

                    Outstanding @cvp!

                    i am just about to get into objc_utils so i dont think of there yet for solutions lol i was going to try and get a script to buffer copies of open tabbed files then close originals. then compare to make sure they closed without corruption or anything, and so on.. i really need to jump into objc_utils lol

                    Appologies for so many typos...

                    here you go @tactfulgamer from cvp ↴

                    @cvp said:

                    @stephen you could define this little script as a Pythonista tool, it will close all tabs

                    from objc_util import *
                    
                    @on_main_thread
                    def main():
                    	win = UIApplication.sharedApplication().keyWindow()
                    	root_vc = win.rootViewController()
                    	if root_vc.isKindOfClass_(ObjCClass('PASlidingContainerViewController')):
                    		tabs_vc = root_vc.detailViewController()
                    		for tab in tabs_vc.tabViewControllers():
                    			if tab.isKindOfClass_(ObjCClass('PA2UniversalTextEditorViewController')):
                    				tabs_vc.closeTab_(tab)  
                    
                    if __name__ == '__main__':
                    	main() 
                    
                    cvp 1 Reply Last reply Reply Quote 0
                    • cvp
                      cvp @stephen last edited by

                      @stephen I had already written that here but, at this moment, to close the edited tab did crash, and now, it doesn't

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