Merge pull request #59 from viko16/master

Add LaunchBar action
This commit is contained in:
Sunnyyoung 2017-12-12 15:22:43 +08:00 committed by GitHub
commit cd43c17a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 0 deletions

View File

@ -17,6 +17,9 @@
![](Screenshot/0x02.png)
### LaunchBar action
![](Screenshot/0x03.png)
## 功能
- 阻止消息撤回

View File

@ -17,6 +17,9 @@ A dynamic library tweak for WeChat macOS.
![](Screenshot/0x02.png)
### LaunchBar action
![](Screenshot/0x03.png)
## Feature
- Prevent message revoked

BIN
Screenshot/0x03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIdentifier</key>
<string>com.viko16.LaunchBar.action.WeChatTweak</string>
<key>CFBundleName</key>
<string>WeChatTweak</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LBAbbreviation</key>
<string>wc</string>
<key>LBDescription</key>
<dict>
<key>LBAuthor</key>
<string>viko16</string>
<key>LBEmail</key>
<string></string>
<key>LBSummary</key>
<string>A LaunchBar action for WeChatTweak.</string>
<key>LBTwitter</key>
<string></string>
<key>LBWebsiteURL</key>
<string>https://github.com/viko16</string>
</dict>
<key>LBScripts</key>
<dict>
<key>LBDefaultScript</key>
<dict>
<key>LBAcceptedArgumentTypes</key>
<array>
<string>string</string>
</array>
<key>LBKeepWindowActive</key>
<true/>
<key>LBLiveFeedbackEnabled</key>
<true/>
<key>LBRequiresArgument</key>
<true/>
<key>LBResultType</key>
<string>unknown</string>
<key>LBReturnsResult</key>
<true/>
<key>LBScriptName</key>
<string>default.js</string>
</dict>
</dict>
<key>LBTextInputTitle</key>
<string>Search your friend...</string>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -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);
}