diff options
Diffstat (limited to 'SharedSupport')
-rw-r--r-- | SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist | 29 | ||||
-rw-r--r-- | SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist | 9 |
2 files changed, 36 insertions, 2 deletions
diff --git a/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist b/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist index 56cdd9c4..8983a3ae 100644 --- a/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist +++ b/SharedSupport/Default Bundles/CopySingleLineQuoted.spBundle/command.plist @@ -7,7 +7,34 @@ <key>category</key> <string>Query Editor</string> <key>command</key> - <string>cat | perl -ne 'chomp;s/\t/ /g;s/"/\\"/g;print "\"".$_."\" . \"\\n\" .\n"' | sed '$ s/.........$//' | sed '$ s/$/;/' | __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy</string> + <string># read STDIN which contains the string data coming from the Query Editor +# and pipe it to the following perl script +cat | perl -ne ' + +# delete final line ending +chomp; + +# substitute TABs by SPACEs +s/\t/ /g; + +# escape " +s/"/\\"/g; + +# output text and pipe it to sed +print "\"".$_."\" . \"\\n\" .\n"' | + +# delete last ‘"\n" .’ (the 9 last characters) +sed '$ s/.........$//' | + +# append ; +sed '$ s/$/;/' | + +# pipe the result to the UNIX command pbcopy which pastes +# the result into the clipboard; +# __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 tells pbcopy +# that the string is UTF-8 encoded +__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy +</string> <key>contact</key> <string>znvy@ovovxb.qr</string> <key>description</key> diff --git a/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist b/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist index 3588396e..b3eb463b 100644 --- a/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist +++ b/SharedSupport/Default Bundles/WrapInDelimiter.spBundle/command.plist @@ -7,8 +7,15 @@ <key>category</key> <string>Query Editor</string> <key>command</key> - <string>echo "DELIMITER \${0:;;}" + <string># write DELIMITER plus ;; as suggestion selected as snippet +echo "DELIMITER \${0:;;}" + +# `cat` reads the STDIN which contains the selected +# text from the Query Editor and write it as selected +# snippet plus the mirrowed suggested delimiter echo "\${1:`cat`}\${1:\$0}" + +# write DELIMITER plus ; echo "DELIMITER ;"</string> <key>contact</key> <string>znvy@ovovxb.qr</string> |