Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Jul 30, 2009, 09:42 AM   #1
macrumors regular
Join Date: Mar 2008
Creatubg a loop

Hey guys,

I have some compression software I'm using that I need to create a loop command for. Long story, but basically I need the script to read if my compression status is still running. If it is, I need it to keep checking until it is done.

The following basic command gave returned this info when I ran it while compressing some video:

tell application "cleaner 6.5.1" to GetEncoderStatus
it returned:

{ProcessingState:ProcessRunning, NumPasses:2, CurrentPass:1, PercentDone:9.0}

I need to create a loop that either says if the ProcessingState=ProcessRunning, or if the PercentDone<100.0, then loop back and check again.
If the ProcessingState=ProcessStopped , or the PercentDone=100.0, quit cleaner 6.5.1

I just don't know how to write a script for a loop, or which would be the more stable variable to go by.

I posted some of the dictionary below. I don't know if this will help or not. Thanks in advance guys.

GetEncoderStatus v : get the current encoding status
→ EncodingStatus : current state

EncodingStatus n
ProcessingState (ProcessStopped/ProcessRunning/ProcessPaused/ProcessSleeping, r/o)
NumPasses (integer, r/o)
CurrentPass (integer, r/o)
PercentDone (real, r/o)

BatchItemStatus v : Get the status of a given batch item.
BatchItemStatus integer : index of the batch item
→ bi_NoSetting/bi_Ready/bi_Paused/bi_Encoding/bi_Analyzed/bi_Skip/bi_SettingError/bi_Flattening/bi_Stopped/bi_Unflattened/bi_Done/bi_ErrorEncoding/bi_Flattened/bi_Deleted/bi_Uploading/bi_Uploaded/bi_ErrorUploading

Last edited by thriftinkid; Jul 30, 2009 at 10:03 AM. Reason: left out info
thriftinkid is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Recovery Loop | Cant get iPhone 5 6.1.3 out of loop Fatush iPhone Tips, Help and Troubleshooting 1 Sep 19, 2013 09:14 PM
iPod Touch: Reboot loop :( fiatpanda iOS 7 2 Jul 6, 2013 05:18 PM
iPhone: iPHone 4 stuck in DFU loop then boot loop then DFU loop! urbanmacUser Jailbreaks and iOS Hacks 1 Jun 7, 2013 04:30 PM
restart loop SiaChris MacBook 4 May 28, 2013 09:45 AM
iPhone 4 Stuck on restore loop, Help! I'm stuck on anger and frustration loop! vegas60 iPhone Tips, Help and Troubleshooting 3 Nov 8, 2012 08:49 AM

Forum Jump

All times are GMT -5. The time now is 01:28 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC