Thank you, Paul.
Good to know there's no need for the "tell... end tell" statement targeting
the Finder! Does this mean the ³MacScript² instruction can be considered as
someting equivalent to a ³tell ³Excel²... end tell² instruction?
No. Scripting Addition commands do not necessarily (and do not usually) have
to be directed at an application. You're not scripting the Finder here, nor
are you scripting the 'current application' (which I think is what you're
asking re Excel). In some cases - for example 'display dialog' - one of the
Standard Additions - it is in fact directed to the current application if
not in a tell block. But most other osax commands including 'keys pressed'
have nothing to do with any application any more than
set a to 24
is directed to an application. This one is just pure AppleScript
(AppleScript is a system component), and scripting additions are just that -
additions or extensions to AppleScript.
On the other hand, there¹s a problem in your version, the:
If System.OperatingSystem = "Macintosh" Then
...line won't run. It has to be changed to:
If Application.OperatingSystem Like "Mac*" Then
...or:
If Left(Application.OperatingSystem, 3) = "Mac" Then
...as the "OperationSystem" Property returned in my case is " ;Macintosh
(Power PC) 10.37".
How strange. What's the issue with your system version? (And what's that "
;" at the beginning? Left(,3) isn't going to work there.)
System.OperatingSystem = "Macintosh" on my machine - I tested it. I'm
running 10.3.8.
Also, you twice suggest Application.OperatingSystem. Are you sure?
OperatingSystem is not a Property of Application, it's a Property of System
object (or of Application.System if you insist). Was that just a slip, or
does it really work for you? The Application.OperatingSystem syntax errors
here.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.