Configuration file
An dict in the Actions is an icon, and because Popclip does not support executing the executable directly, use the shell to execute it.
The color of the two icons given by yourself is not related, Popclip automatically modifies the color of the icon.
<?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>Actions</key>
<array>
<dict>
<key>After</key>
<string>copy-result</string>
<key>image file</key>
<string>id.png</string>
<key>regular expression</key>
<string> (s) 1\w+$</string>
<key>Title</key>
<string>Url2Id</string>
<key>shell Script file</key>
<string>url2id.sh</string>
</dict>
<dict>
<key>After</key>
<string>copy-result</string>
<key>image file</key>
<string>url.png</string>
<key>regular expression</key>
<string> (s) \d+$</string>
<key>Title</key>
<string>Id2Url</string>
<key>shell Script file</key>
<string>id2url.sh</string>
</dict>
</array>
<key>Apps</key>
<array>
<dict>
<key>Link</key>
<string>http://tool.lu/</string>
<key>Name</key>
<string> Online Tools </string>
</dict>
</array>
<key>Credits</key>
<array>
<dict>
<key>Link</key>
<string>mailto:245565986@qq.com</string>
<key>Name</key>
<string>xiaozi</string>
</dict>
</array>
<key>extension description</key>
<string>convert IDs for Mogujie.</string>
<key>extension identifier</key>
<string>lu.tool.popclip.extension.id-converter</string>
<key>extension Image file</key>
<string>id.png</string>
<key>extension name</key>
<string>id converter</string>
<key>Version</key>
<integer>1</integer>
</dict>
</plist>
Code
The text of the popclip operation is placed directly in the environment variable popclip_text, so the following code can be used as a plugin template for Go
Package Main
Import (
"FMT"
"OS"
)
Func Main () {
Text: = OS. Getenv ("Popclip_text")
Fmt. Print (text)
}
Go Build-o idconverter.
Release
MV Idconverter/idconverter.popclipext
Zip-r IdConverter.popclipext.zip Idconverter.popclipext
MV IdConverter.popclipext.zip Idconverter.popclipextz