Activate Applescript from Excel

In OS 10.4 (Tiger), is there any syntax to take the place of MacScript and then path to the appleScript in quotation marks?
Old Example:
Sub OpenApplescript()
MacScript “Hard Disk:Folder:AppleScript”
End Sub


What version of Excel?

Don’t you run a script from the script menu?

Thanks for writing. I am trying to create a sheet of buttons which would list all the slide shows.

I know that in Office 2004 you can use the “do script” command. Should not matter what version of OSX you’re using.

Thanks for your reply. I can’t get either one of them to work in 2004. Can you send me an example of the do script function assuming the AppleScript is in a folder on the hard disk. I tried the following: do script "open file "\AppleScript name" of folder "\folder name" of disk “\hard disk name"”

Jack Karnes
jackkarnes@mindspring.com

I’m not sure I understand the question correctly. This works for me in Excell 2004 on Mac OS X 10.4.2 (and most likely, earlier versions of Excel & Mac OS X):

Sub displayDialog() Dim s As String s = Range(Selection.Address) MacScript "display dialog ""The current selection is: " + s + """ buttons {""OK""} default button 1 with icon 1 giving up after 20" End Sub
Select a cell with some content then run the macro. To open an AppleScript saved as an application, you either have to target the Finder to open it or just tell the app itself to activate:

Sub openSelection() Dim s As String s = Range(Selection.Address) MacScript "tell application ""Finder"" to open item """ + s + """ of folder ""folder name"" of startup disk" ' MacScript "tell application """ + s + """ to activate" End Sub
To run a compiled script not saved as an app, I use a “run script” call:

Sub runScript() Dim s As String s = Range(Selection.Address) MacScript "run script ((""path:to:parent folder:" + s + ".scpt"") as alias)" End Sub
Jon

Thanks Jonn8 for your help. I had to do a littlel adjusting (quotation marks, etc), but with your scripts I was able to get it to work. My actual script is as follows:

Sub openAmericas()
Dim s As String
s = (“Americas”)
MacScript “tell application ““Finder”” to open item “”” + s + “”" of folder ““XSlide Show Starter”” of startup disk"
End Sub

Americas is the name of the PowerPoint file, and the AppleScript to open “Americas” was in folder “XSlide Show Starter”.

Thanks again for your expertise, really appreciate it.

Jack Karnes