0
我試圖從文件執行代碼,但未能路徑正確的 引用並獲取以下錯誤。引用文件錯誤
Safari got an error:
Can’t get file "Main:Users:Adrian:Documents:Portfolio:automation:explorer:logic.js" of window 1.
我曾嘗試做這樣:
tell application "Safari"
tell window 1
set current tab to make new tab with properties {URL:"...some"}
delay 5
do JavaScript file "Main:Users:Adrian:Documents:logic.js" in current tab
end tell
end tell
和...
tell application "Safari"
tell window 1
set current tab to make new tab with properties {URL:"...some"}
delay 5
do JavaScript (file "Main/Users/Adrian/Documents/explorer.js") in current tab
end tell
end tell
我指定的路徑是我採取的方法從應對文件信息的路徑(釐米d + I)
/Users/Adrian/Documents/logic.js
主要是硬盤驅動器名稱
謝謝你很多,爲了一個很好的解釋。它確實幫了大忙! :) – volna