特定のアプリケーションウィンドウのショートカットまたはメニューアクションを実行します

StackOverflow https://stackoverflow.com//questions/23005807

  •  21-12-2019
  •  | 
  •  

質問

実際にすべてのXcode Openedプロジェクト(アプリケーションウィンドウ)を介して行くスクリプトオプションがあり、メニューアクション製品を実行する - >ショートカット "CMD +。"?

役に立ちましたか?

解決

各実行の始めに xcode でAppleスクリプトを実行するには、次のようなシェルスクリプトを作成できます。

#!/bin/bash                                                                                                                                                                                                                                   

osascript -e 'tell application "Xcode"                                                                                                                                                                                                        
activate                                                                                                                                                                                                                                      
set activeWindow to window 1                                                                                                                                                                                                                  
set windowName to name of activeWindow                                                                                                                                                                                                        
repeat with aWindow in windows                                                                                                                                                                                                                
    tell application "System Events" to keystroke "`" using command down                                                                                                                                                                          
    if name of aWindow is not equal to windowName then                                                                                                                                                                                            
        if name of aWindow is not equal to "" then                                                                                                                                                                                                    
        tell application "System Events" to keystroke "." using command down                                                                                                                                                                          
        end if                                                                                                                                                                                                                                        
    end if                                                                                                                                                                                                                                        
end repeat                                                                                                                                                                                                                                    
end tell'
.

xcode 環境設定 - > beachiours-> starts-> struckを実行して選択します。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top