Script delete line for xcode
I have some problem with the default script of xcode, here is my script to delete line :
on run
tell application "System Events"
keystroke (ASCII character 29) using {command down}
keystroke (ASCII character 8) using {command down}
keystroke (ASCII character 8)
end tell
end run
(command right ; command delete; delete)
The script work but, it do not delete the empty line when i use a keyboard shortcut ("command D" for me).
Please help me to make it work.开发者_开发问答
The problem is that when you press Command ⌘ + D, the script is executed and it presses the keys you've assigned. When the script tries to keydown backspace, you are still pressing the command key. So, it will actually press CMD+backspace.
Change the command key to option key in the shortcut. This way, you can delete the lines properly.
精彩评论