Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Applescript send get or post requests?

I use Hazel to organize downloaded files on my Mac. I see i can make it run applescripts every time it triggers a rule.

I was wondering if it is possible to make it send something like:

http://my.server.com?type=Show&name=Big+Bang+Theory

Then i could create a small page that logs all downloads.

like image 278
andeersg Avatar asked Oct 01 '12 18:10

andeersg


1 Answers

Sure, the command line utility curl is one way. Applescripts can use command line utilities with the "do shell script" command. So try this...

set theURL to "http://my.server.com?type=Show&name=Big+Bang+Theory"
do shell script "curl " & quoted form of theURL

The above will return the page results to applescript. Maybe you'd rather just open the link in your default browser...

set theURL to "http://my.server.com?type=Show&name=Big+Bang+Theory"
open location theURL

So take your pick!

like image 90
regulus6633 Avatar answered Nov 09 '22 02:11

regulus6633