2015-01-02 44 views
1

我在嘗試導航到外部腳本的路徑時遇到編譯器錯誤,這是因爲我在用戶名中有一段時間。有誰知道在AppleScript中解決這個問題的正確語法? 這是我使用的設置路徑名的字符串代碼:路徑名期間

set thePropertyScriptPath to (path to /Users/firstname.lastname/Desktop) & "Properties.scpt" 

回答

2

是否需要在那裏,不只是路徑桌面?

set thePropertyScriptPath to path to desktop folder as text 
set thePropertyScriptPath to (thePropertyScriptPath & "Properties.scpt") as string 
+0

你是男人!這正是我需要的。 – John

+0

由於字符串和文本相同。第二行不需要字符串......也不需要()。它應該閱讀設置thePropertyScriptPathPropertyScriptPath&「Properties.scpt」 – adayzdone

+0

更好的是...設置PropertyScriptPath(作爲文本的桌面路徑)&「Properties.scpt」 – adayzdone