diff --git a/DragCommands/Insert Image With Dimensions.tmDragCommand b/DragCommands/Insert Image With Dimensions.tmDragCommand new file mode 100644 index 0000000..e992aa7 --- /dev/null +++ b/DragCommands/Insert Image With Dimensions.tmDragCommand @@ -0,0 +1,33 @@ + + + + + command + img="$TM_DROPPED_FILE" +echo -n "<img src=\"$img\" " + +sips -g pixelWidth -g pixelHeight "$img" \ +|awk '/pixelWidth/ { printf("width=\"%d\" ", $2) } + /pixelHeight/ { printf("height=\"%d\" ", $2) }' + +base=${img##*/} +alt=$(tr <<<${base%.*} '[_-]' ' '|perl -pe 's/(\w+)/\u$1/g') +echo -n "alt=\"$alt\" />" + + draggedFileExtensions + + png + jpeg + jpg + gif + + name + Insert Image With Dimensions + output + insertAsSnippet + scope + text.html + uuid + 2AFCB76A-1D12-4520-A3B7-30A7F527DA1A + + diff --git a/info.plist b/info.plist index 91ce830..e94a7ad 100644 --- a/info.plist +++ b/info.plist @@ -247,6 +247,7 @@ AC460DE9-5703-4FDA-8729-D635BD3F50B3 2AF2A5A5-1009-4F85-A5D5-8FC94C72325D 8C3B4AE6-7DDE-4B71-B8DE-187CDD609F66 + 2AFCB76A-1D12-4520-A3B7-30A7F527DA1A uuid 99BA94C1-0202-4A79-BBF5-A9279B16E2A6