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.


    WiFi Name

    Pythonista
    3
    7
    1825
    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.
    • DavinE
      DavinE last edited by

      Hello Guys,

      I have a Question, is it Possible That Pythonista can Return the current wifi Name ? Or ssid Nummer to Check wich wifi is connected ?

      Thanks for reply ✌️

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

        https://forum.omz-software.com/topic/3905/wifi-ssid/7

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

          @ccc,

          I Found this too, but i get the error: "No method found for selector "isKindOfClass:"

          The Name of the Wifi Works as well for me

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

            @DavinE you could launch shortcut action "get wifi network name" and get back from Shortcuts app

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

              @DavinE try, named a.py (or change in shortcut)

              import webbrowser
              import sys
              
              if len(sys.argv) == 1:
              	webbrowser.open('shortcuts://run-shortcut?name=getwifinetworkname')
              else:
              	print(sys.argv[1])
              

              With shortcut getwifinetworkname https://www.icloud.com/shortcuts/872a7164f48742dea11e585c209a94a5

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

                @DavinE still better, without stopping your app

                import clipboard
                import webbrowser
                import time
                
                webbrowser.open('shortcuts://run-shortcut?name=getwifinetworkname')
                time.sleep(1)	
                t = clipboard.get()
                print(t)
                

                The shortcut

                • get the wifi name
                • copies it in the clipboard
                • opens Pythonista without running a new script, only to reset the running script foreground

                The best solution should be to make Shortcuts running in background, but no actual way, except for an automation

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

                  And the best solution (if it works):

                  You could even define a shortcut with an automation "when my iDevice connects to any wifi network" with actions:

                  • get wifi name
                  • copy it into a file (in Shortcuts folder)

                  This shortcut will run in background.

                  Your script, when it needs this wifi name, should only read this file (in external Shortcuts folder ) and should get the current wifi name.

                  To be tested, obviously

                  Édit: automation works, at each network update, not tested with a file but with clipboard

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