• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Need to run script periodically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need to run script periodically


  • Subject: Need to run script periodically
  • From: Brian Christmas <email@hidden>
  • Date: Sun, 12 Feb 2017 11:03:08 +1100

G’day scripters

I’m trying to get a script to stay open, and run every 10 seconds, but getting a ‘stack overflow’.

I don’t want to enter any terminal commands to run it periodically, as I don’t want it to be permanant.

I’ve tried this, but the shell script to quit & restart does not seem to recognize scripts.

I know the path is OK, with   display dialog FolderActions

It’s the ‘killall’ that doesn’t seem to work. Only for .apps apparently. Or is there some special process I can kill?


Also tried an ‘idle’ command, but the script quits.


It’s called as a folder action script, so I can’t save as an App.

Any suggestions please?

Regards

Santa


global FolderActions

tell application "Finder"
set FolderActions to POSIX path of (path to Folder Action scripts folder from user domain)
end tell
try
say 1
do shell script ("killall 'ftp Downloader'&&sleep 10&&open -a FolderActions&'ftp Downloader.scpt'")
say 2
on error errMsg
tell application "System Events" to display dialog errMsg giving up after 5
end try
say 3
do shell script ("sleep 10")
tell me to run

Errors with  sh: ftp Downloader.scpt: command not found
No matching processes belonging to you were found


on run
say "start"
my SetUpFile2()
end run

on idle
tell me to run
return 10
end idle

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Next by Date: drag-drop question
  • Next by thread: drag-drop question
  • Index(es):
    • Date
    • Thread