Results 1 to 3 of 3

Thread: iPhone Personal Hotspot support

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    1

    Default iPhone Personal Hotspot support

    Hello! I love ToothFairy for connecting to my headphones… I was wondering if there was any chance of adding support for one-click connection to my iPhone’s Bluetooth Personal Hotspot?

    This would be the equivalent of choosing this menu item:

    Click image for larger version. 

Name:	Screenshot 2019-06-25 at 09.13.42.png 
Views:	71 
Size:	432.0 KB 
ID:	738



    Thank you!
    Tom

  2. #2

    Default

    Quote Originally Posted by tomgilder View Post
    I was wondering if there was any chance of adding support for one-click connection to my iPhone’s Bluetooth Personal Hotspot?

    This would be the equivalent of choosing this menu item:

    Click image for larger version. 

Name:	Screenshot 2019-06-25 at 09.13.42.png 
Views:	71 
Size:	432.0 KB 
ID:	738
    You can do this by setting a “Run shell script after connecting” script in ToothFairy. Then when you click the icon, it will connect to the hotspot. The script could look something like:

    Code:
    #!/bin/sh
    osascript << EOF
    set DeviceName to "Tom's iPhone"
    
    tell application "System Events" to tell process "SystemUIServer"
        set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
        click bt
        if exists menu item DeviceName of menu of bt then
            tell (first menu item whose title is DeviceName) of menu of bt
                click
                tell menu 1
                    if exists menu item "Connect to Network" then
                        click menu item "Connect to Network"
                        return "Connecting..."
                    else
                        key code 53 -- hit Escape to close BT menu
                        return "No connect button; is it already connected?"
                    end if
                end tell
            end tell
        else
            key code 53 -- hit Escape to close BT menu
            return "Cannot find that device, check the name"
        end if
    end tell
    EOF

  3. #3

    Default

    Quote Originally Posted by Michael Tsai View Post
    You can do this by setting a “Run shell script after connecting” script in ToothFairy. Then when you click the icon, it will connect to the hotspot. The script could look something like:

    Code:
    #!/bin/sh
    osascript << EOF
    set DeviceName to "Tom's iPhone"
    
    tell application "System Events" to tell process "SystemUIServer"
        set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
        click bt
        if exists menu item DeviceName of menu of bt then
            tell (first menu item whose title is DeviceName) of menu of bt
                click
                tell menu 1
                    if exists menu item "Connect to Network" then
                        click menu item "Connect to Network"
                        return "Connecting..."
                    else
                        key code 53 -- hit Escape to close BT menu
                        return "No connect button; is it already connected?"
                    end if
                end tell
            end tell
        else
            key code 53 -- hit Escape to close BT menu
            return "Cannot find that device, check the name"
        end if
    end tell
    EOF

    thanks sir, this worked.

    Thanks again.

Similar Threads

  1. Yosemite/iphone
    By timan42 in forum SpamSieve
    Replies: 7
    Last Post: 11-13-2014, 11:01 AM
  2. MacBook v. iPhone
    By Mark905 in forum SpamSieve
    Replies: 1
    Last Post: 06-06-2013, 12:20 PM
  3. personal replies marked as spam
    By barefoot in forum SpamSieve
    Replies: 6
    Last Post: 12-21-2009, 03:26 PM
  4. iPhone Spam help.
    By whokilledkaji in forum SpamSieve
    Replies: 1
    Last Post: 07-19-2008, 10:01 AM
  5. Replies: 2
    Last Post: 08-11-2007, 02:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •