1

I want to make an OS X app which continuously capture photo in some time interval and send that photo to the server via any service (HTTP/Socket).

I searched about this and get that to achieve the same I need to make a daemon service (using launchd) for mac which will run on background.

But I am still confused with the procedure.

For example, I have created a plist file

<?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>com.me.lc1</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Documents/LD/FirstScript.sh</string>
    </array>
    <key>OnDemand</key>
    <false/>
    <key>Nice</key>
    <integer>1</integer>
    <key>StartInterval</key>
    <integer>10</integer>
    <key>StandardErrorPath</key>
    <string>/Documents/LD/Error_log.log</string>
    <key>StandardOutPath</key>
    <string>/Documents/LD/Output_log.log</string>
</dict>
</plist>

I copied plist file to ~/Library/LaunchAgents

Then use the command

launchctl load ~/Library/LaunchAgents/com.me.lc1.plist

But I am not getting any output now.

For the photo capture, I am using imagesnap (Referred):

./imagesnap

How can I achieve photo capture and service (HTTP/Socket) implementation in background?

How I can send photo to the server in background?

Need help.

0 Answers0