diff --git a/alfred.rb b/alfred.rb index dd09a16..02975e1 100644 --- a/alfred.rb +++ b/alfred.rb @@ -65,6 +65,12 @@ def icon text def attribute(att, value) attributes[att.to_s] = value end + def largetype(text) + self << elem_with_text(:text, text, "type" => "largetype") + end + def copy(text) + self << elem_with_text(:text, text, "type" => "copy") + end private def elem_with_text(label, text, attrs = {}) diff --git a/kuaidi_query.rb b/kuaidi_query.rb index e0f69e6..3ee8e12 100644 --- a/kuaidi_query.rb +++ b/kuaidi_query.rb @@ -20,7 +20,7 @@ def format_alfred_detail(detail) attribute :arg, detail[:data].collect{|r| format_status_record(r,nil)}.join(";") title decode_company( detail[:com]) + ' ' + detail[:nu] icon 'icon.png' - subtitle 'Shift 显示详情 | Enter 复制到剪切板' + subtitle 'Shift 显示详情 | Enter 复制到剪切板 | ⌘L 屏幕显示' end total = detail[:data].size @@ -32,6 +32,8 @@ def format_alfred_detail(detail) subtitle context, "shift" icon record[:context] =~ /签收/ ? 'success.png' : ( ind.zero? ? 'truck.png' : 'up.png' ) attribute :arg, context + largetype context + copy context end end