iTunes and podcasts issues

First, is it possible to update podcasts without having to open iTunes? Like do it in the background.

Second, and my most important question is: Is there any way to see the runtime of a program through AppleScript?

For example, I want to do something like this:

tell “System Events”
if runtime of process “iTunes” < 5 seconds then
do something
end if
end tell

Any help would be appreciated!

Thanks!

And one more thing, I know there is a command like “Waiting for application responses” but I can’t remember the exact wording. What is it again?

Like,

Tell “iTunes”
do this waiting for response
end tell

thanks

Hi,

  1. you can get the runtime of a process with this subroutine
get_ProcessTime("iTunes")

on get_ProcessTime(proc)
	try
		tell application "System Events" to set pid to the unix id of process proc as Unicode text
		return paragraph 2 of (do shell script "ps -p " & quoted form of pid & "  | awk '{ print $4 }'")
	on error
		return "0"
	end try
end get_ProcessTime

but I guess, the returned string has a special format (not just mm:ss)

  1. you probably mean
ignoring application responses
	-- do something	
end ignoring

default is considering, that means AppleScript waits for the response of the application

moved to OS X forum