PopClip plug-in development instance in mac

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.