2

The situation: My mobile carrier offers for free to send SMS notifications by following a URL.

What I'd want: Include these URLs in various scripts to get notifications when I'm away from keyboard.

The problem: I can't find a way to open the URL silently (that is without opening it in a browser), the simplest thing:

do shell script "open https://myurl"

opens a tab and brings my browser to the front, so I'd have to close the tabs either manually or with some other lines in the script.

Is there's a more elegant way to do as if I had followed the link without showing it in a browser?

3
  • Not 100% sure what you want but you should try a "Headless Browser"
    – JBis
    Sep 13, 2018 at 0:13
  • I would love to know which carrier this is! Would you update if you’re still having issues - I’d also hope to refine my answer and get you an answer that works with that carrier.
    – bmike
    Jun 27, 2020 at 20:59
  • It's a French Internet provider called Free. I forgot about that question to be honest because I don't use the script I would have liked to receive SMS from anymore, but now that I think of it (and from what I learned in between!) maybe the best solution would have been to attach a python script to whatever I was doing to make a request.
    – NicolasPP
    Jun 28, 2020 at 21:23

1 Answer 1

2

For sure there are dozens of tools to do this.

  • python scripts
  • ruby scripts
  • swift scripts
  • javascript scripts
  • shell scripts

I’d start with bash and shell, but you could do this in dozens of ways. Javascript and bash are all easy to call from AppleScript as well if you want to start there. The curl command ships with all macOS so let’s start there. Open the terminal app and type:

curl https://myurl

Once you get the basics of calling, you can determine if you need authentication or to post / get to an API to trigger the actions you need, but all of the above scripts will not open a browser and will retrieve / hit the web site with a real request that can make things happen.

2
  • Yes I'm looking for a shell script if possible, but I think I have to add details, my url is something like that: smsapi.mycarrier.sendmsg?user=myusernumber&pass=mykey&m… If I curl that url it outputs this: [1] 1379 [2] 1380 [2]+ Done pass=mykey And I don't get the sms.
    – NicolasPP
    Sep 13, 2018 at 0:19
  • 1
    Yes. You might want to ask a second question the is there any way is a yes. You can post the details of the exact URL and then people can help with a framework to handle cookies or authentication or offer a tool like PAW to help you understand the actual API being called so you can automate it.
    – bmike
    Sep 13, 2018 at 2:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .