diff --git a/README-Chinese.md b/README-Chinese.md index f52c77f..4c1d742 100644 --- a/README-Chinese.md +++ b/README-Chinese.md @@ -17,6 +17,9 @@ ![](Screenshot/0x02.png) +### LaunchBar action +![](Screenshot/0x03.png) + ## 功能 - 阻止消息撤回 diff --git a/README.md b/README.md index 962f71c..ec72d94 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ A dynamic library tweak for WeChat macOS. ![](Screenshot/0x02.png) +### LaunchBar action +![](Screenshot/0x03.png) + ## Feature - Prevent message revoked diff --git a/Screenshot/0x03.png b/Screenshot/0x03.png new file mode 100644 index 0000000..0f1a10b Binary files /dev/null and b/Screenshot/0x03.png differ diff --git a/WeChatTweak.lbaction/Contents/Info.plist b/WeChatTweak.lbaction/Contents/Info.plist new file mode 100644 index 0000000..f40600f --- /dev/null +++ b/WeChatTweak.lbaction/Contents/Info.plist @@ -0,0 +1,53 @@ + + + + + CFBundleIconFile + icon.png + CFBundleIdentifier + com.viko16.LaunchBar.action.WeChatTweak + CFBundleName + WeChatTweak + CFBundleVersion + 1.0 + LBAbbreviation + wc + LBDescription + + LBAuthor + viko16 + LBEmail + + LBSummary + A LaunchBar action for WeChatTweak. + LBTwitter + + LBWebsiteURL + https://github.com/viko16 + + LBScripts + + LBDefaultScript + + LBAcceptedArgumentTypes + + string + + LBKeepWindowActive + + LBLiveFeedbackEnabled + + LBRequiresArgument + + LBResultType + unknown + LBReturnsResult + + LBScriptName + default.js + + + LBTextInputTitle + Search your friend... + + diff --git a/WeChatTweak.lbaction/Contents/Resources/icon.png b/WeChatTweak.lbaction/Contents/Resources/icon.png new file mode 100644 index 0000000..5e457bd Binary files /dev/null and b/WeChatTweak.lbaction/Contents/Resources/icon.png differ diff --git a/WeChatTweak.lbaction/Contents/Scripts/default.js b/WeChatTweak.lbaction/Contents/Scripts/default.js new file mode 100644 index 0000000..fd3fe16 --- /dev/null +++ b/WeChatTweak.lbaction/Contents/Scripts/default.js @@ -0,0 +1,32 @@ +// LaunchBar Action Script + +function run(string) { + if (!string) return []; + + var url = 'http://localhost:48065/wechat/search?keyword='; + var result = HTTP.getJSON(url + encodeURIComponent(string.trim())); + + if (result == undefined) { + LaunchBar.alert('HTTP.getJSON() returned undefined'); + return []; + } + + if (result.error != undefined) { + LaunchBar.log('Error in HTTP request: ' + result.error); + return []; + } + + return result.data.map(function (i) { + return { + title: i.m_nsRemark || i.m_nsNickName, + subtitle: i.m_nsNickName, + icon: "icon.png", + action: "open", + actionArgument: i.m_nsUsrName + } + }); +} + +function open(id) { + HTTP.get('http://localhost:48065/wechat/start?session=' + id); +} \ No newline at end of file