Ben böyle Güvenlik & Gizlilik seçenekleri penceresini açın biliyor? Kullanıcıların doğru ekranı bulmasını kolaylaştırmak istiyorum. Erişilebilirlik API'sının şu anda devre dışı bırakıldığını unutmayın; bu, Gizlilik sekmesinde etkinleştirmeye çalıştığım şeydir. (Bu bir new feature in 10.9'dur.)Kullanıcıları otomatik olarak Sistem Tercihleri ➞ Gizlilik'e yönlendirebilir miyim?</p> <pre><code>open /System/Library/PreferencePanes/Security.prefPane </code></pre> <p>programlı Gizlilik sekmesine gidin mümkün mü:
cevap
AXProcessIsTrustedWithOptions
'u daha önce bulduğunuz, kullanıcının gizlilik erişilebilirlik ayarlarına doğrudan erişmesini sağladığınız your answer to the other topic; Muhtemelen the official alert provided by that function'dan daha az şaşkınlık ve şüphe uyandıran kendi kullanıcı istemi uygulamak isteyeceksiniz.
Sen Güvenlik & Gizlilik tercihleri bölmesini açın ve kullanarak Erişilebilirlik bölümüne düz gezinebilirsiniz AppleScript:
:tell application "System Preferences"
--get a reference to the Security & Privacy preferences pane
set securityPane to pane id "com.apple.preference.security"
--tell that pane to navigate to its "Accessibility" section under its Privacy tab
--(the anchor name is arbitrary and does not imply a meaningful hierarchy.)
tell securityPane to reveal anchor "Privacy_Accessibility"
--open the preferences window and make it frontmost
activate
end tell
Seçeneklerden biri AppleScript Editor ile bir applescript dosyaya bu kaydedip doğrudan yürütmektir
osascript path/to/applescript.scpt
Eşdeğer komutları, Object C uygulamasından, Scripting Bridge yoluyla da gerçekleştirebilirsiniz. Bu, Sistem Tercihleri komut dosyası API'sini betimleyici nesneler olarak ortaya çıkaran bir Objective C üstbilgisi (Apple'ın komut satırı araçlarını kullanarak) oluşturmanız gerektiğine daha da fazla katkıda bulunuyor. (Kafayla nasıl oluşturulacağı ile ilgili ayrıntılar için Apple's Scripting Bridge documentation bakınız.)
Düzenleme: Bir Sistem Tercihleri başlığı oluşturduktan sonra aşağıdaki Objective C kodu yukarıdaki AppleScript aynı işi yapar:
//Get a reference we can use to send scripting messages to System Preferences.
//This will not launch the application or establish a connection to it until we start sending it commands.
SystemPreferencesApplication *prefsApp = [SBApplication applicationWithBundleIdentifier: @"com.apple.systempreferences"];
//Tell the scripting bridge wrapper not to block this thread while waiting for replies from the other process.
//(The commands we'll be sending it don't have return values that we care about.)
prefsApp.sendMode = kAENoReply;
//Get a reference to the accessibility anchor within the Security & Privacy pane.
//If the pane or the anchor don't exist (e.g. they get renamed in a future OS X version),
//we'll still get objects for them but any commands sent to those objects will silently fail.
SystemPreferencesPane *securityPane = [prefsApp.panes objectWithID: @"com.apple.preference.security"];
SystemPreferencesAnchor *accessibilityAnchor = [securityPane.anchors objectWithName: @"Privacy_Accessibility"];
//Open the System Preferences application and bring its window to the foreground.
[prefsApp activate];
//Show the accessibility anchor, if it exists.
[accessibilityAnchor reveal];
Ancak, Scripting Bridge uygulamasının korumalı uygulamalar tarafından kullanılmadığını (en son kontrol ettiğimi) unutmayın.
- 1. Git, <<<<<<< HEAD dosyasına
- 2. Sınıfta sabit << otomatik blok
- 3. <: <İş nasıl?
- 4. Java, bitshifts kullanırken, neden 1 << 32! = 1 << 31 << 1?
- 5. Objective-C'de özel yönergeler oluşturmak mümkün mü?</p> <ul> <li>@interface</li> <li>@implementation</li> <li>@end</li> <li>@protocol bence</li> <li>@property</li> <li>@synthesize</li> </ul> <p>:
- 6. "<%:" ne yapıyor?</p> <pre><code><%: Model.FirstName %> </code></pre> <p>"<%:" Ne vermez: do
- 7. EJS: <% = versus <% -
- 8. Ruby'de <=>'i tanımlayabilir ve sonra ==,>, <, > =, ve <= otomatik olarak tanımlanabilir misiniz?
- 9. Bot'um argümanlarla nasıl yanıt verir?</p> <ul> <li><code>/list</code></li> <li><code>/info 123</code></li> </ul> <p>Ben <code>/info</code> yakalamak ve gibi ek argümanlar iletebilirsiniz gibi bu harika çalışıyor:
- 10. Ondalık değeri: cout << dec << boost :: this_thread :: get_id()
- 11. Kanal seç <- <- Kanal
- 12. İçindeki eleman sayısı <5 in <a1 <0</ a1><T>
- 13. <nedir? ve <? php
- 14. Nedir? ve << demek?
- 15. css: 2 veya <code><thead></code> yılında <code><tr></code> daha varsa <tr>
- 16. Akış çıkışında <yerine <neden hala <çoğum?
- 17. <section>, <nav> ve <article>
- 18. Şu izle ifadem tutan bana gösteriyor Şu anda bir</p> <pre><code>Expression<Func<T,bool>> </code></pre> <p>bir</p> <pre><code>Expression<Func<T,object>> </code></pre> <p>dönüştürmek çalışıyorum
- 19. XPath - tüm elemanlar alt elemanlara belge</p> <pre><code><a> <b> <c/> <d/> </b> <b> <c/> <d/> </b> </a> </code></pre> <p>Verilen
- 20. Heroku birden fazla web süreci</p> <p><code>for /url1/ some process</code></p> <p>ve</p> <p><code>for /url2/ another</code></p> <p>ya da bazı liman manipülasyon gibi
- 21. loglama performansı ve operatör <<
- 22. İçinde Gettext kullanarak PHP <<< EOF dizgisi
- 23. PureScript'te üçlü işaret (<<< `) işareti ne kadar azdır?
- 24. Groovy:</p> İşte <pre><code>param = args[0] println(param) </code></pre> <p>bunu çalıştırmak nasıl (Windows 7):</p> <pre><code>groovy test.groovy a&b </code></pre> <p>beklediğim bu senaryo bir & b yazdırır
- 25. </p> <pre><code>var tpl = ` <div> template <span>string</span> </div> ` </code></pre> <p>üretecektir
- 26. Linq:</p> <p><code>Company</code>, <code>Invoice</code> ve ondalık özelliği <code>Price</code> sahiptir <code>InvoiceLine</code>: toplamlar
- 27. Object # <MongoClient> 'open' yöntemi yok
- 28. Bu garip koşullu operatör sözdizimi nedir?</p> <pre><code>bool bRes = (a < b) ? a=b, true : false; </code></pre> <p><code>a < b</code>, o zaman <code>a=b</code> infaz ve <code>bRes</code> doğrudur edilir:
- 29. Görev veri bölgesi NO_PREF. Ne zaman kullanılır?</p> <ul> <li>PROCESS_LOCAL HERHANGİ</li> <li>NODE_LOCAL</li> <li>NO_PREF</li> <li>RACK_LOCAL</li> <li></li> </ul> <p>Hepsi oldukça açıktır: doc Spark göre
- 30. Django <input><label>
Teşekkür ederiz! Evet, sadece bir tıklatma tıklaması ve tüm kullanıcıların kolayca görmezden geleceği bazı korkutucu metinlerin yanı sıra kullanıcıyı herhangi bir değer eklemeden Sistem Tercihleri'ne yönlendiren aptal sistem diyaloğundan kaçınmaya çalışıyorum. – zoul