Applescript

May 29th, 2009 -- No Comments

So I decided to look at Apple Scripting and I will tell you it is not that bad. I still have to kind the site that has all the built-in keywords but it works. Let me show you a little script I made that will prompt you to type in a PHP function name(mysql_connect) and it will open up your browser and take you to the PHP page with that function

1
2
3
set phpfunction to text returned of (display dialog “Which PHP Function do you want to look up?” default answer “”)
 
open location “http://www.php.net/” & phpfunction

Let me explain what is going on here. The set phpfunction is creating a variable that will hold the text. Display dialog is setting up a prompt Window. The dialog has 2 parts. First part is what is text is going to display in the box. The second part is if you wanted some default text in the text box where the user would type in.

The open location is telling it to open your web browser. The & phpfunction is adding the function you typed in the box to the URL string. And that is it for some Apple Script.

Categories: Apple Script, Mac OS, Tutorials