LoginSignup
1
1

More than 5 years have passed since last update.

How to develop a LaunchBar extension

Posted at

How to develop a LaunchBar extension

1.Duplicate the SampleExtension.lbaction

/Users/soushi/OneDrive/BackUps/LaunchBarExtension/SampleExtension.lbaction

2.Open the package

2.1 Right click on the extension file and then click the "Show Package Contents".

How to develop a launchbar extension fig1.png

3.Edit Info.plist file

Original Info.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>CFBundleIdentifier</key>
    <string>jp.soushi.sampleid</string>
    <key>CFBundleIconFile</key>
    <string>com.apple.iChat</string>
    <key>CFBundleName</key>
    <string>Sample Extension</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LBRequiredApplication</key>
    <string>com.apple.iChat</string>
    <key>LBScripts</key>
    <dict>
        <key>LBDefaultScript</key>
        <dict>
            <key>LBScriptName</key>
            <string>default.scpt</string>
            <key>LBRequiresArgument</key>
            <true/>
            <key>LBAcceptedArgumentTypes</key>
            <array>
                <string>string</string>
            </array>
        </dict>
    </dict>
    <key>LBDescription</key>
    <dict>
        <key>LBSummary</key>
        <string>This action sends the file to the specified contact in Messages.app.</string>
        <key>LBAuthor</key>
        <string>Soushi Yamamoto</string>
        <key>LBWebsite</key>
        <string>http://www.soushi.jp/</string>
        <key>LBTwitter</key>
        <string>@soushiy</string>
    </dict>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2014 Soushi Yamamoto</string>
</dict>
</plist>

3.1 Change the Extension Name

<string>Sample Extension</string> -> <string>New Extension Name</string>

<key>CFBundleName</key>
<string>New Extension Name</string>

3.2 Change the Extension Identifier

jp.soushi.sampleid -> jp.soushi.newextensionid

<key>CFBundleIdentifier</key>
<string> jp.soushi.newextensionid </string>

3.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>default.scpt</string> -> <string>NewScriptFileName.scpt</string>

<key>LBScriptName</key>
<string>NewScriptFileName.scpt</string>

4 Change the apple script

This is the example for sending the specified file using the Messages app.

on open _files
    display dialog "Enter the address(To):" default answer "mail@soushi.jp"
    set toaddress to text returned of result
    repeat with _targetfile in _files
        tell application "Messages"
            send _targetfile to buddy "mail@soushi.jp" of service ("E:" & toaddress)
        end tell
    end repeat
end open

5 Install the extension

5.1 Double click the extension file(.lbaction)

How to develop a launchbar extension fig2.png

1
1
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
1