Hi everyone:

I am attempting to create a LaunchAgent that will copy a file to a specific
location at login and when the file changes.  My code is below, however I
just can't find out how to make it copy the file without using AppleScript.
I was thinking a cp command passing it the locations, but I am not sure how
to implement this within the plist file of the LaunchAgent.  Right now this
application just opens Safari to demonstrate that it actually works.

<?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>Label</key>
    <string>Resuscitation</string>
    <key>Program</key>
    <string>/usr/bin/osascript</string>
    <key>ProgramArguments</key>
    <array>
        <string>osascript</string>
        <string>-e</string>
        <string>tell application "Safari"</string>
        <string>-e</string>
        <string>open</string>
        <string>-e</string>
        <string>end tell</string>
    </array>
    <key>WatchPaths</key>
    <array>
        <string>/Users/PATH/TO/FILE</string>
    </array>
</dict>
</plist>

Any help would be very appreciated.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to