If I want my applescript to run only every 5 seconds, how do I do this?
If I want my applescript to stop itself when the program it is controling quits, what do I need to code?
+ Reply to Thread
Results 1 to 8 of 8
-
-
i think i can answer your question, but you have to give some more specifics as to what you're trying to accomplish and which app you're trying to control. post some more info and i'll help you out.
nick -
I'm writting an applescript that will update my aim profile with the song currently playing in iTunes. I can get it to do that, but the problem is when you close AIM the script is still running. So it opens AIM back up and updates my profile. When I close AIM I want the script to stop.
-
that type of script sounds like it may be too processor intensive (more so than necessary) if you do it via applescript.. there is actually already a system preference pane that does the job quite well, if you are just looking to get your feet wet with applescript i suggest another task to tackle
http://www.versiontracker.com/dyn/moreinfo/macosx/17192
thas the vt link for the pane ichat status.As below, so above and beyond, I imagine
drawn outside the lines of reason.
Push the envelope. Watch it bend.
Over thinking, over analyzing separates the body from the mind. Withering my intuition leaving all these opportunities behind. -
Actually I have used the iChat version, but it didn't work under AIM,only iChat. Here is what I have so far.
Code:repeat tell application "iTunes" -- now get some info set myTrackName to name of current track set myTrackAlbum to album of current track -- note alternate syntax: set myTrackArtist to current track's artist set myTrackGenre to current track's genre end tell tell application "AOL Instant Messenger (SM)" if online then set profile to "I am listening to " & myTrackArtist & "-" & myTrackName & ". Off the album " & myTrackAlbum & ". It is a " & myTrackGenre & " song." end if end tell end repeat
-
bilestyle is correct, unfortunaly cpu cycles are used during the delay.
However, this is what you were asking for, just change Safari to AIM.
repeat
tell application "System Events"
set SafariExists to get (process "Safari" exists)
if SafariExists = false then exit repeat
display dialog "Safari is running"
delay 5
end tell
end repeat
display dialog "Safari is not running" -
I was reading the May 2003 issue of Macworld and found 2 things that may be of interest.
iChatStatus 1.2 - www.ittpoi.com
Kung-Tunes 2.1 - www.kung-foo.tv
i checked out the ittpoi site but couldn't find iChatStatus???
found it at versiontracker www.versiontracker.com/dyn/moreinfo/macosx/17192
Don't know if this is what you're looking for but though it might help.
jbcandkcI'm just sitting here watching the wheels go round and round.
-John Lennon -
Thanks for the links, but they don't work with AIM. I've kinda given up on the project, but it did help me with my coding know-how.
Similar Threads
-
ffmpegx/snow leopard applescript problem
By jape in forum ffmpegX general discussionReplies: 1Last Post: 22nd Sep 2009, 11:00 -
AppleScript Error when trying to author DVD with subtitles
By Chopper Face in forum ffmpegX general discussionReplies: 5Last Post: 2nd Jul 2008, 23:25 -
AppleScript Error _iframeflag is not defined (-2753)
By linea in forum ffmpegX general discussionReplies: 3Last Post: 30th Jun 2008, 12:51 -
AppleScript Error
By stembridge in forum ffmpegX general discussionReplies: 5Last Post: 1st Mar 2008, 09:44 -
Leopard AppleScript Errors
By brittohalloran in forum ffmpegX general discussionReplies: 2Last Post: 2nd Jan 2008, 14:52