Last active
September 15, 2017 04:33
-
-
Save mim-Armand/6b6548d30a5dedbb66e4 to your computer and use it in GitHub Desktop.
setinterval for adobe extend script v 0.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(); | |
function main() { | |
var myIdleTask = app.idleTasks.add({ | |
name: “my_idle_task”, | |
sleep: 1000 | |
}); | |
var onIdleEventListener = myIdleTask.addEventListener(IdleEvent.ON_IDLE, onIdleEventHandler, false); | |
} | |
// SETINTERVAL DOSNT EXIST SO WE USE THE ONLY POSSIBLE WAY ONIDLE EVENT: | |
function onIdleEventHandler(myIdleEvent) { | |
var myTextFrames = app.activeDocument.pages.item(0).textFrames; | |
mimWinPnl.pgr.value +=1; | |
if(mimWinPnl.pgr.value > 99){ // progress bar value | |
//Delete idle task by setting its sleep time to zero. | |
myIdleEvent.parent.sleep = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment