├── info.plist ├── Support └── bin │ ├── copy_url │ └── open_dropbox ├── Commands ├── Copy Message URL.mmCommand └── Reveal SaneAttachments.mmCommand └── README.md /info.plist: -------------------------------------------------------------------------------- 1 | { "contactEmailRot13" = "zr@oergggrecfgen.pbz"; 2 | contactName = "Brett Terpstra"; 3 | description = "A Bundle for MailMate."; 4 | name = "MailMateMate"; 5 | uuid = "A7332E3E-8564-4E58-85BD-340847F20645"; 6 | } 7 | -------------------------------------------------------------------------------- /Support/bin/copy_url: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -wKU 2 | require 'cgi' 3 | 4 | unless ENV['MM_MESSAGE_ID'].nil? 5 | msg_url = "message://%3c" + CGI.escape(ENV['MM_MESSAGE_ID']) + "%3e" 6 | 7 | %x{echo #{msg_url} | tr -d '\n' | pbcopy} 8 | end 9 | -------------------------------------------------------------------------------- /Commands/Copy Message URL.mmCommand: -------------------------------------------------------------------------------- 1 | { 2 | name = 'Copy Message URL'; 3 | environment = 'MM_MESSAGE_ID=${message-id.split}\n'; 4 | command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/copy_url"'; 5 | keyEquivalent = "@y"; 6 | uuid = '9EDA249E-8C33-4A5B-8EC5-6C6F134DA6C8'; 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MailMateMate.mmBundle 2 | ===================== 3 | 4 | A simple MailMate bundle for experimentation. 5 | 6 | ```bash 7 | mkdkr -p '~/Library/Application Support/MailMate/Bundles' 8 | cd '~/Library/Application Support/MailMate/Bundles' 9 | git clone https://github.com/ttscoff/MailMateMate.mmBundle.git 10 | ``` -------------------------------------------------------------------------------- /Commands/Reveal SaneAttachments.mmCommand: -------------------------------------------------------------------------------- 1 | { 2 | name = 'Reveal SaneAttachments'; 3 | environment = 'MM_SENDER=${from}\n'; 4 | input = "canonical"; 5 | command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/open_dropbox"'; 6 | keyEquivalent = "@y"; 7 | uuid = 'CFF4FECE-E021-11E7-AA42-72000629A420'; 8 | } 9 | -------------------------------------------------------------------------------- /Support/bin/open_dropbox: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -wKU 2 | 3 | content = $stdin.read.force_encoding('utf-8') 4 | 5 | if content =~ /Dropbox\/SaneBox\/(\S+.*)\// 6 | sender = $1 7 | path = "#{ENV['HOME']}/Dropbox/SaneBox/#{sender}" 8 | files = content.scan(/(?i)^(.*?)(?=\n\s+https:\/\/www.dropbox)/) 9 | file_arr = [] 10 | files.each {|f| 11 | posix = File.join(path,f[0].strip) 12 | file_arr.push(%Q{(POSIX file "#{posix}")}) 13 | } 14 | path = "{" + file_arr.join(',') + "}" 15 | %x{echo "#{path}" | pbcopy} 16 | begin 17 | %x{osascript -e 'tell application "Finder"' -e 'activate' -e 'select #{path}' -e 'end tell'} 18 | rescue 19 | %x{osascript -e 'tell application "Finder" to display dialog "Failed to open #{path}"'} 20 | end 21 | end 22 | --------------------------------------------------------------------------------