2016-11-17 81 views
3

我需要在啓用沙箱的應用中使用AppleScript。只要使用諸如「告訴Finder bla bla bla」的東西。很簡單。我得到了我需要做記錄的用於取景享權利是這樣的:如何爲取景器設置權利?

<key>com.apple.security.scripting-targets</key> 
<dict> 
    <key>com.apple.mail</key> 
    <array> 
     <string>com.apple.mail.compose</string> 
    </array> 
</dict> 

是否有人知道在XCode中的用於取景正確的權利記錄?我嘗試使用下一個選項:

<key>com.apple.security.scripting-targets</key> 
    <dict> 
     <key>com.apple.finder</key> 
     <string>com.apple.finder</string> 
    </dict> 

但它不起作用。

回答

3

Finder不支持scripting targets,因此您需要使用先前的臨時異常。

<key>com.apple.security.temporary-exception.apple-events</key> 
<array> 
    <string>com.apple.finder</string> 
</array> 
+0

是的,我也試過了。由於某些原因,AppleScript不起作用。這是我的授權文件: ' com.apple.security.app的沙箱 \t \t com.apple.security.temporary-exception.apple事件 \t ' \t com.apple.finder \t ' 我嘗試運行下一個腳本: '告訴應用程序\「搜索\」 \ n重新啓動\ n結束tell' 但什麼也沒有發生:-( –

+0

對不起內嵌代碼:-)如何設置在這裏換行? –

+0

'Restart'實際上是'System Events'的一部分,並傳遞給Finder。嘗試使用'系統事件' – vadian