• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

AppleScript question

I'm new to AppleScript, am going through the Visual QuickStart guide.

Every time I write a script or run any script that uses the

display command "whatever"

I get an error message that says

"whatever" doesn't understand the display dialog message

I'm taking these right out of the book... other commands work fine but this most basic of activities (a dialog box) is simply not working. Any ideas?

One possible issue - I'm on 8.6, could not find the Script Editor, installed AppleScript from an 8.5 disk. Is it something to do w/ libraries or mismatched files?
0
68k
Asked:
68k
  • 2
  • 2
1 Solution
 
boonstraCommented:
I'm not sure what examples you are looking at, but I think what you want is:

display dialog "whatever"

You can also add buttons to the dialog if you like:

display dialog "Some text" {"OK"} default button 1

Without knowing what installs you did, I can't know if you have a library compatability problem, but you can get the latest Applescript SDK at:
<ftp://ftp.apple.com/developer/Development_Kits/AppleScript/>
0
 
68kAuthor Commented:
Whoops. I apologize.

My code was actually:

display dialog "whatever"

as you suggested.

I don't know why I typed "command" above.

Sorry for that.

So, in short, the simple "display dialog" command gives an error message for me.

If anyone has any idea why, let me know.

I'm going to try this on a different machine.
0
 
boonstraCommented:
I've been able to reproduce your error by removing the "Standard Additions" file from the "Scripting Additions" folder of the system folder.  Consequently I suspect your installation is hosed.

I'd recommend reinstalling AppleScript using the URL in my original answer.
0
 
68kAuthor Commented:
That folder and its files are intact, so I'm sure that isn't the issue specifically... but a clean reinstall of the OS now allows this script to run as I would have expected - no error, just a nice dialog box!

Your suspicion of a bad installation was correct. This must have been it.

Thanks for the link and general advice. It's most appreciated.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now