LoginSignup
1
0

More than 5 years have passed since last update.

How to make a popclip extension

Posted at

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

3 Duplicate the folder and add the ".popclipext" extension to the folder.

3.1 Add the extension

How to develop a popclip extension fig1.png

3.2 Click "Add"

How to develop a popclip extension fig2.png

4 Install the extension

4.1 Double click the extension file(.popclipext)

How to develop a popclip extension fig3.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0