Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7899549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:43:54+00:00 2026-06-03T08:43:54+00:00

I’m new here. And I need help on applescript. Currently i’m using USB Modem

  • 0

I’m new here. And I need help on applescript.

Currently i’m using USB Modem to connect to internet, it’s an everyday routine so i can work. But i want to make it run automaticaly when i plugged the USB modem to my MBP, and run script to connect internet with using configuration that already set.

Here is the script that i use to connect to Internet.

tell application "System Events"
tell current location of network preferences
    set modem to service "Flexi EVDO"
    set isConnected to connected of current configuration of modem
    if isConnected then
        disconnect modem
    else
        connect modem
    end if
end tell
end tell

I ran this script using automator and save it as App.

What i want to achieve is if i can run this script directly when i plugged my USB Modem.
I’m stuck at detecting the modem script. I have no idea about this.

Can anyone help me? Thanks in advance. Really appreciated every comments.
Sorry for my bad english.

Thanks! again. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:43:56+00:00Added an answer on June 3, 2026 at 8:43 am

    Your english is very good so don’t worry about that. The first thing to do it to figure out if you can detect if the modem is plugged-in. We can use the system profiler for this. Plug in your device and run the following command in the Terminal. Find your device in the output and find its serial number.

    system_profiler SPUSBDataType
    

    Put that serial number in the first line of this script…

    set deviceSerialNumber to "CCCB1010221740331521362502"
    
    try
        set theResult to do shell script "system_profiler SPUSBDataType | grep " & deviceSerialNumber
        set theStatus to "The device is available."
    on error
        set theStatus to "The device is not available."
    end try
    

    See if the script works by plugging and unplugging your device. If so then you have the basics of a solution. Now you just need a way to run this automatically. In applescript you can create a “stay-open” application and you can use that to run your script automatically every few seconds. You can google for how to create that.

    NOTE: I do not think it is a good solution to have a script running every few seconds for this purpose. It’s a waste of your computer’s resources. However I can’t think of another method to suggest. I really think your best solution is to just run your current script by hand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want use html5's new tag to play a wav file (currently only supported
I have thousands of HTML files to process using Groovy/Java and I need to
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.