How to make a popclip extension
1.Duplicate the SampleExtension folder.
/Users/soushi/OneDrive/BackUps/PopclipExtension/SampleExtension
2.Edit Config.plist
Original Config.plist
<?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>AppleScript File</key>
<string>RunTerminalCommand.applescript</string>
<key>Image File</key>
<string>FIND.png</string>
<key>Title</key>
<string>Run Terminal Command</string>
</dict>
</array>
<key>Credits</key>
<array>
<dict>
<key>Link</key>
<string>http://soushi.jp/</string>
<key>Name</key>
<string>Soushi Yamamoto</string>
</dict>
</array>
<key>Extension Description</key>
<string>Find the file from the selected text</string>
<key>Extension Identifier</key>
<string>jp.soushi.sample</string>
<key>Extension Image File</key>
<string>RTC.png</string>
<key>Extension Name</key>
<string>Sample Extension</string>
</dict>
</plist>
2.1 Change the Extension Name
<string>New Extension</string>
-> <string>New Extension Name</string>
<key>Extension Name</key>
<string>New Extension</string>
2.2 Change the Extension Identifier
jp.soushi.sample -> jp.soushi.newextensionid
<key>Extension Identifier</key>
<string>jp.soushi.newextensionid</string>
2.3 Change the apple script location(optional)
If you want to change the file name of the script, you should fix the location setting in the Config.plist file.
<string>RunTerminalCommand.applescript</string>
-> <string>NewScriptFileName.applescript</string>
<key>AppleScript File</key>
<string>NewScriptFileName.applescript</string>
2.4 Change the apple script
This is the example for launch the app(searchCopiedFileName) from the terminal.
tell application "Terminal"
activate
-- If there are no open windows, open one.
if (count of windows) is less than 1 then
do script ""
end if
set theTab to selected tab in first window
do script "open -a 'searchCopiedFileName' --args '{popclip text}'" in theTab
do script "exit" in theTab
end tell