Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
ASP

You are correct about ASP.

The server processes the VBScript or JScript embedded within HTML in an ASP page to build dynamic content. The page is then transported across HTTP to your browser as HTML (with a URL that contains asp as the file extension since you requested the server to deliver the processed asp page).
 
Re: Applescript safari

Originally posted by artistry
Apple have (quietly) released some Applescripts for Safari
It wasn't really so quiet. The link is right on the main http://www.apple.com/safari/ page.

I posted a question yesterday about whether anyone had tried writing an AppleScript for Safari yet. Has anyone done so yet?

If you AppleScript programmers need a suggestion, how 'bout a simple script that prompts you for your first name and last name (e.g., Desmond Llewelyn), or lets you drag it out of your address book, then forms the You Are My Friend URL (e.g., http://Desmond.Llewelyn.youaremyfriend.com/) and finally sends you there. (If you haven't tried the You Are My Friend site, just fill in your own name and type in the URL yourself.)
 
Re: Re: Applescript safari

Originally posted by Doctor Q

If you AppleScript programmers need a suggestion, how 'bout a simple script that prompts you for your first name and last name (e.g., Desmond Llewelyn), or lets you drag it out of your address book, then forms the You Are My Friend URL (e.g., http://Desmond.Llewelyn.youaremyfriend.com/) and finally sends you there. (If you haven't tried the You Are My Friend site, just fill in your own name and type in the URL yourself.)

Here - copy this into script editor and run it.

Shoudl work:

display dialog "Enter your Forename" default answer "Forename" buttons {"Cancel", "OK"} default button 2
set myForename to the text returned of the result
display dialog "Enter your Surname" default answer "Surname" buttons {"Cancel", "OK"} default button 2
set mySurname to the text returned of the result
set target_URL to "http://" & myForename & "." & mySurname & ".youaremyfriend.com/"

open location target_URL


Nice and simple! :)
 
Thanks for the AppleScript, artistry. It works perfectly. In fact, it works no matter which web browser is your default, since it doesn't use anything Safari-specific.

artistry, you are my friend!

I guess I didn't give you scripters much of a challenge. OK, now I need an AppleScript that solves the following problems and formats the answers as a web page in Safari:

* What is the correct TOE (theory of everything) in physics?

* How can we prevent war and famine and cure all known diseases?

* How do you prove or disprove the Riemann Hypothesis in mathematics?

* Why is Zsa Zsa Gabor famous?

I thank you in advance.
 
Now that you are done laughing at my joke (you DID laugh at my joke, didn't you?), here's a serious question.

I tried the "Full Screen" AppleScript posted at http://www.apple.com/applescript/safari/.

Supposedly, the script "hides the Dock and expands the front browser window to fill the screen".

When I run it, this line in the script:

set dock_showing to do shell script "defaults read com.apple.dock autohide"

produces this error message:

defaults[493]
The domain/default pair or
(com.apple.dock, autohide) does not exist


Why?
 
Originally posted by Doctor Q
Thanks for the AppleScript, artistry. It works perfectly. In fact, it works no matter which web browser is your default, since it doesn't use anything Safari-specific.

artistry, you are my friend!

I guess I didn't give you scripters much of a challenge. OK, now I need an AppleScript that solves the following problems and formats the answers as a web page in Safari:

* What is the correct TOE (theory of everything) in physics?

* How can we prevent war and famine and cure all known diseases?

* How do you prove or disprove the Riemann Hypothesis in mathematics?

* Why is Zsa Zsa Gabor famous?

I thank you in advance.

Oh that's easy...

display dialog "The answer to your question is 42" buttons {"Cancel", "OK"} default button 2 :D
 
Originally posted by Doctor Q
Now that you are done laughing at my joke (you DID laugh at my joke, didn't you?), here's a serious question.

I tried the "Full Screen" AppleScript posted at http://www.apple.com/applescript/safari/.

Supposedly, the script "hides the Dock and expands the front browser window to fill the screen".

When I run it, this line in the script:

set dock_showing to do shell script "defaults read com.apple.dock autohide"

produces this error message:

defaults[493]
The domain/default pair or
(com.apple.dock, autohide) does not exist


Why?

I get an error message when it tries to count my windows. Mmmm...

Do you have your dock set to autohide? Try switching that off - does it work then?
 
Autohide on. Autohide off. Same problem. I don't really need this script to work; I was just experimenting, so don't worry about it.
 
Originally posted by Doctor Q
Autohide on. Autohide off. Same problem. I don't really need this script to work; I was just experimenting, so don't worry about it.

But I do... :(

Applescript is an odd beast - but that's the price you pay for something so, erm, 'friendly'. I do like it, but occasionally it acts a bit strange...
 
I puzzled and puzzled over a simple bug in an AppleScript I wrote for the computer teacher at a local school where I volunteer. It was a script to open or close all the student folders, arranging them neatly on the screen. For the window-closing routine, I counted the windows and then had a loop close "window N" for each N. I was totally baffled when it didn't work, until I figured out that as soon as you close a window, the meaning of "window 1", "window 2", etc. changes. What used to be "window 2" might now be "window 1". I had a good laugh at my own expense but I learned that even the simplest tasks can throw you off if you're missing a concept.
 
Originally posted by Doctor Q
I figured out that as soon as you close a window, the meaning of "window 1", "window 2", etc. changes. What used to be "window 2" might now be "window 1". I had a good laugh at my own expense but I learned that even the simplest tasks can throw you off if you're missing a concept.

Yep, that got me last week actually. Even with Applescript you still have to think like a computer!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.