Tôi cắt và dán các ví dụ mục tiêu-C ra khỏi Safari vào Xcode nhưng định dạng bị sai lệch. Tôi biết tôi có thể làm nhiều tìm và thay thế cho {và \ r, nhưng có một nút nào đó đang sửa ở đâu đó không? Tùy chọn/plugin Xcode. Plugin TextEdit v.v.?Định dạng mã mục tiêu-C
trả lời: Tôi tạo ra một AppleScript trong TextWrangler
tell application "TextWrangler"
activate
replace "- (" using "\\r- (" searching in text 1 of text document "untitled text" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
select find window
select text 1 of find window
replace ";" using ";\\r" searching in text 1 of text document "untitled text" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
select find window
replace "{" using "{\\r" searching in text 1 of text document "untitled text" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
select find window
replace "//" using "\\r//" searching in text 1 of text document "untitled text" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
end tell
Tôi đã sử dụng TextWrangler nó có tùy chọn để ghi lại một bản ghi chép sau đó đã tìm/thay thế để thêm \ r sau}; và - ( –