[英]How to automate Xcode 4 to do Find & Replace (using both textual and regex styles)?
我正在嘗試使用AppleScript自動進行手動查找和替換,但沒有運氣。
有沒有辦法做到這一點?
沒有直接的方法來做到這一點。 Xcode 4中的腳本不如我們想要的那么強大。 您可以使用GUI腳本執行此操作。 這是一個示例腳本,用於設置查找和替換文本,然后單擊“全部替換”按鈕。 顯然你會想要為自己的用途修改它,但它說明了原則。
tell application "Xcode"
activate
end tell
tell application "System Events"
tell process "Xcode"
keystroke "f" using {command down, option down}
set value of text field 1 of group 1 of splitter group 1 of group 2 of splitter group 1 of group 1 of front window to "<string>"
set value of text field 2 of group 1 of splitter group 1 of group 2 of splitter group 1 of group 1 of front window to "<string2>"
click button "Replace All" of group 1 of splitter group 1 of group 2 of splitter group 1 of group 1 of front window
end tell
end tell
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.