I have been searching via google and forums for the last three days - so I apologize ahead of time if this is apparent and I’ve missed something, as I’m very new to Applescript and MacOS.
I’m using Snow Leopard 10.6.2 and the pre existing AppleScript.
I am trying to call an application to launch via file path:
tell application “Applications/Microsoft Office 2004/Microsoft Word.app” to launch
It tells me it cannot find that directory
However if I use terminal:
open /Applications/Microsoft\ Office\ 2008/Microsoft\ Word.app
The application launches. However, if I use the same command for Microsoft office 2004 it tells me it cannot be located - so I find I’m having difficulty solving this problem with perhaps a quick and easy shell script to launch via Applescript (as I’ve read can be done).
The end goal is I have two versions of office on this Mac, 2004 and 2008 I need to be able to launch them all (both versions) with a script. Can this be done?
Thank you so much for the help! I tried the script and it works perfectly. Now I need to figure out how to chain them together because if I just run
set applicationFolder to path to applications folder as text
tell application (applicationFolder & “Microsoft Office 2004:Microsoft Word”) to launch
set applicationFolder to path to applications folder as text
tell application (applicationFolder & “Microsoft Office 2008:Microsoft Word”) to launch
It tells me the second office 2008 wasn’t found.
Ultimately I want to launch both full suites at the same time (word, excel, powerpoint, entourage). Thank you!
Not sure (I’m not on my mac right now), but I guess paths are case-sensitive.
Isn’t your last problem coming from the fact that you wrote “office” instead of “Office”?
You can try a more indirect route, and let Finder do the opening for you instead of launching the application directly from AS. This seems to work on my system (10.5):
tell application "Finder"
set officepath to (path to applications folder) & "Microsoft Office 2004:Microsoft Word" as text
open officepath
set officepath to (path to applications folder) & "Microsoft Office 2008:Microsoft Word" as text
open officepath
end tell
Thank you very much Warhaven - the indirect route has worked and I can chain them all together to open both suites at once. Thank you so much - now I need to pick up a book and start from the beginning I think.