我這里有這個腳本,需要掛載一個網路檔案夾,驗證它是否已掛載,然后啟動應用程式。當 'tell application appName to activate' 在 'tell application "System Events"' 陳述句之外時,它可以作業。但正如下面所寫,應用程式將無法打開。此外,當我用“QuickBooks”替換“appName”時,程式會打開,如下所示。
任何幫助將不勝感激。
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
uj5u.com熱心網友回復:
改變
tell application appName to activate
到
tell me to tell application appName to activate
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/407172.html
標籤:
上一篇:為什么我無法在Linux的VirtualBox網路中ping主機(路由器)?
下一篇:哪個目錄最適合保存日志?
