Problems with Launch .plist

G’day all


Problem, Apple advised me that the StartCalendarInterval keys must start with Caps, so I’ve fixed it.


Now the Launch plist won't work every three minutes. Should the ‘KeepAlive’ key be true? It’s not on other plists I’ve checked.

Also, my called App starts with ‘On run’. It ran every minute when the plist was faulty, but not now. Is the ProgramArguments correct? Should ‘run’ be something else in the App?.


Is it possible to add a ‘say’ statement to the plist to check it’s running. My App is supposed to say ‘Oz’ every time it runs.


Regards


Santa


KeepAlive Boolean NO

ProgramArguments Array (3 items)

item 0 String /urs/bin/open

item 1 String -n

item 2 String /Users/OzSanta/Library/Iput Methods/Text Edit.ap

StartCalenderInterval Dictionary (2 items)

Hour Number 0

Minute Number 3


try


# Create plist

set p to 6

set PPath to (ptul & "com.CCC.Runner.plist") as text

set PPathTwo to ((POSIX path of thePathTwo) & "/Text Edit.app") as text

#set PArguments to {}

set p to 7

set Program to ((POSIX path of thePathTwo) & "/Text Edit.app") as text

set p to 8

set PArguments to {}

set p to 9

set end of PArguments to "/usr/bin/open"

set end of PArguments to "-n"

set p to 10

set end of PArguments to Program

set p to 11

set StartDict to current application's NSDictionary's dictionaryWithDictionary:{|Hour|:0, |Minute|:3}

try

set myDict to current application's NSDictionary's dictionaryWithObjects:{false, "com.CCC.Runner", StartDict, PArguments} forKeys:{"KeepAlive", "Label", "StartCalendarInterval", "ProgramArguments"}

on error errmsg

tell application "System Events" to display dialog "Setting myDict for Trap" & errmsg

end try

#

#

try

try

do shell script ("launchctl unload ~/Library/LaunchAgents/com.CCC.Runner.plist")

on error errmsg

tell application "System Events" to display dialog errmsg

end try

do shell script ("sleep 1")

myDict's writeToFile:PPath atomically:true

do shell script ("sleep 1")

try

say 1

do shell script ("launchctl load ~/Library/LaunchAgents/com.CCC.Runner.plist")

say 2

on error errmsg

tell application "System Events" to display dialog errmsg

end try

on error errmsg number errnum

tell application "System Events" to display dialog ("saveTheTrapData " & errmsg as text)

end try

set p to 8


on error errmsg number errnum

tell application "Finder" to launch

tell application "System Events" to display dialog ("setUpTrap setting plist error " & errmsg & " p = " & p as text)

end try