I have this script here that needs to mount a network folder, verify that it is mounted, and then start the application. When 'tell application appName to activate' is outside the 'tell application "System Events"' statement, it works. But as it is written below, the application will not open. Additionally, when I replace 'appName' with "QuickBooks", the programs opens as it is written below.
Any help would be greatly appreciated.
set hostname to "TestHost"
set shareFolder to "TestShare"
set user to "TestUser"
set pw to "P@ssword"
set appName to "QuickBooks"
try
set networkPath to "/volumes/" & shareFolder
mount volume "smb://" & hostname & "/" & shareFolder as user name user with password pw
end try
tell application "System Events"
if exists folder networkPath then
tell application appName to activate
else
display alert "Unable to find QuickBooks Database."
end if
end tell
CodePudding user response:
Change
tell application appName to activate
to
tell me to tell application appName to activate