I have a very simple test scrip that I want my computer to run every 60 seconds -
time_test_script.py. The script simply saves a
.txt file with current time as name and writes some text onto the file. The file is in
path = '/Users/me/Desktop/test_dir'
name_of_file = '%s' %datetime.datetime.now()
completeName = os.path.join(path, name_of_file+".txt")
file1 = open(completeName, "w")
toFile = 'test'
I also have a
.plist file –
test.plist that is in
<?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">
If I run the script manually it works fine, i.e. is creates a
.txt file in the specified directory. However, when I try to initiate
launchctl from the Terminal nothing happens.
$ launchctl load /Library/LaunchAgents/test.plist
$ launchctl start com.test
What am I doing wrong?