I know I can use <createsymlink> to create a desktop link; but how can I use the <target> tag to link to a shell script ? If I point the <target> to a shell script, the short cut will launch a text editor and open the script for editing.

Any idea ? thanks ray

asked 21 May '12, 18:32

alpharay's gravatar image

alpharay
1111
accept rate: 0%


In this case, the best approach is to create your own .app bundle (i.e. Script.app directory with Contents/Info.plist and all other required resources). You can put the script to run in the Info.plist file - such as:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleExecutable</key>
    <string>script.sh</string>
    <key>CFBundleGetInfoString</key>
    <string>Sample script</string>
    <key>CFBundleIconFile</key>
    <string>script.icns</string>
    <key>CFBundleIdentifier</key>
    <string>com.example.script</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Sample script</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>3.0</string>
    <key>CFBundleSignature</key>
    <string>Sample Script</string>
    <key>CFBundleVersion</key>
    <string>3.0</string>
</dict>
 </plist>

Then you need to create your script as Contents/MacOS/script.sh. Similarly, icons should go to Contents/Resources.

You can find more information in Bundle Programming Guide from Apple.

link

answered 22 May '12, 05:37

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×42

Asked: 21 May '12, 18:32

Seen: 4,591 times

Last updated: 22 May '12, 05:37