Why does this script behavior change with the phase of the moon ?

Can anyone from adobe corp or non-adobe volunteers tell me where to look in their docs to find out why this script change its behavior or how to use the debugger to figure out the same. I read the guide and the whole section on debugger and break points etc well.
try{
this.getField('Button4').strokeColor = color.red   ;
app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 500 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 1000 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.red   ;" , 1500 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 2000 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 2500 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.red   ;" , 3000 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 3500 );
app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 4000 );
catch(e){}
Sometimes the above script cycle thru all the colors in proper order and other time it get stuck.
I have linked it to a button so its part of the button javascript.
Is there a way to craft setTimeOut calls that it becomes a reliable delay ?
How to craft it such that the file does not change and does not have to be saved ? This is wanted in addition but not the essential issue at the moment.
Thanks,
Rainbow

MAXcount=20
// Create a simple color animation on a field called “Color” that changes every second.
function DoIt() {
  var f = this.getField("Button4");
  var nColor = (timeout.count++ % 10 / 10);
  // Various shades of red.
  var aColor = new Array("RGB", nColor, 0, 0);
  f.fillColor = aColor;
  console.println( 'change' + ' ' + nColor + '; count=' + timeout.count );
  if (timeout.count >= MAXcount)
    app.clearInterval ( timeout );
console.show();
console.clear();
console.println('Start');
// save return value as a variable
timeout = app.setInterval("DoIt()", 1000);
// Add a property to our timeout object so that DoIt() can keep a count going.
timeout.count = 0;
console.println('End of code');
// And observe the results. I expect your new timer events are conflicting with each other. Note that in the above code the change is performed within the called function and not as new line of code.
I ran it but did not follow your last comment and acrobat disk icon prompts for saving the file. Can anyone remove this "latter problem" ? Can it be solved by any means ?

Similar Messages

  • Why does this script changes modification date???

    Hello All,
    I am using this script with an Acrobutton to advise my users of the current PDF version.
    var stmDoc = Collab.documentToStream(this)
    var strDoc = util.stringFromStream(stmDoc);
    var strVer = strDoc.substr(5,3)
    app.alert({cMsg: "The PDF version is: " + strVer, nIcon: 3, nType: 0, cTitle: "PDF Version Check"});
    Problem is that when closing the document, even though not prompted, the file is saved (assumed, since the modification date changes).
    Is there anything about this script that is doing this?

    I added a "this.dirty = false;" to the end, but it does not do as I had hoped. The pdf does not prompt for a save, which is what I understand the dirty flag to be effecting. The modification date changes anyway. Am I not using the dirty flag correctly? Thanks in advance for your help.

  • Why does this script not work when run with osascript cli?

    I wrote the following to interface with geektool to display a list of todo's on my desktop (i'm sure it's been done elsewhere, but I wanted to try it myself). I had it working fine until I tried ordering the output to place the highest priority items at the top of the list. The following code works properly during development in Script Editor, but when geektool launches the command using osascript ~/Library/Scripts/todos.scpt it only displays the initial "TODOS:" without displaying the rest of the info. Searching the Applescript Release notes, I found that some versions of Applescript 1.8 had issues with null characters when using the osascript cli, however, I'm running 1.10.7 so it shouldn't be an issue (and I'm not sure how to check for null characters in Applescript even if it were). Anybody have any ideas on what's going on here?
    set output to {"TODOS:
    set highpri to {}
    set medium to {}
    set low to {}
    set nada to {}
    tell application "iCal"
    repeat with i in calendars
    repeat with j in todos of i
    if (completion date of j as string) is equal to "" then
    if priority of j as string is equal to "high priority" then
    copy summary of j & "
    " to end of highpri
    end if
    if priority of j as string is equal to "medium priority" then
    copy summary of j & "
    " to end of medium
    end if
    if priority of j as string is equal to "low priority" then
    copy summary of j & "
    " to end of low
    end if
    if priority of j as string is equal to "no priority" then
    copy summary of j & "
    " to end of nada
    end if
    end if
    end repeat
    end repeat
    end tell
    return (output & highpri & medium & low & nada) as string

    well, i'd been pulling my hair out for quite a while with this and decided it was time to ask for help, but I thought I'd give it one last shot and found a resolution almost immediately. I figured that problem had to be caused by the way applescript was concatenating the lists, so I got rid of the lists completely and it still wouldn't work. This convinced me that it must be newline related since that was the only special character left in the string. I opened up the script in vi, but the default compiled script format is not human readable. The osascript man page indicated that it would accept both compiled and text scripts, so I gave it a try, and osascript handled the raw text file wonderfully.

  • Why does this script beep at me :-(

    Writing a script that creates job folders and duplicates files, all works great, but when I save the script as an application, I get a beep after every file is copied.
    Perhaps I am doing something wrong, so I created a test script just that just copies files and the same thing happens, when I run it the files get copied, and at the end it beeps once, save it as an application, the files get copied, but I get four beeps.
    this is sample script:
    -- move file test
    tell application "Finder"
    set FromFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveFromFiles:"
    set ToFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveToFiles:"
    set FileName to "NewJob1.txt"
    set MvFile1 to FromFolder & FileName
    set FileName to "NewJob2.txt"
    set MvFile2 to FromFolder & FileName
    set FileName to "test1.tif"
    set MvFile3 to FromFolder & FileName
    set FileName to "test2.tif"
    set MvFile4 to FromFolder & FileName
    duplicate file MvFile1 to ToFolder
    duplicate file MvFile2 to ToFolder
    duplicate file MvFile3 to ToFolder
    duplicate file MvFile4 to ToFolder
    end tell
    as I said this is just a test, my original intent is to copy files from different locations, but this test has the same one beep per file after saving as an application.
    Can I turn off the beep, or am I doing something wrong?
    Thanks

    Hi ErstO. Welcome to Apple Discussions!
    You can hear a beep even when you duplicate a file with ⌘D in the Finder. That's normal. Try this:
    *set FromFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveFromFiles:"*
    *set ToFolder to "Macintosh HD:Users:cls:Scripts Test Center:NewJob:MoveToFiles:"*
    *set MvFile1 to FromFolder & "NewJob1.txt"*
    *set MvFile2 to FromFolder & "NewJob2.txt"*
    *set MvFile3 to FromFolder & "test1.tif"*
    *set MvFile4 to FromFolder & "test2.tif"*
    *set volume with output muted* -- StandardAdditions.osax > Miscellaneous Commands
    *tell application "Finder"*
    *   duplicate file MvFile1 to folder ToFolder* -- the word folder is required before the path
    *   duplicate file MvFile2 to folder ToFolder*
    *   duplicate file MvFile3 to folder ToFolder*
    *   duplicate file MvFile4 to folder ToFolder*
    *end tell*
    *delay 1* -- should be enough
    *set volume without output muted*
    Hope it can help.
    (The script seems to work even without the word folder being put before the ToFolder path. However, if you open the Event Log History window after having run the script, you will see a huge difference.)
    Message was edited by: Pierre L.

  • Why does this constantly freeze up when I am in the middle of a game?

    I was in the middle of playing a yahtzee game and all of a sudden the game froze up? WHY? I realize this is a free service, but come on guys get it together! Or I'll find a different internet provider.

    There are a variety of reasons this may happen. Here are the first things you might try to correct that problem:
    1. Quit the app. Double click the Home button to show the screen with running and recently used apps. Each app icon will have a sample page above it. Flick up on the page (not the app icon) and the page will fly away and the app icon will disappear. This quits that app. Then reset your iPhone. Press and hold both the Home button and the Sleep/Wake button continuously until the Apple logo appears. Then release the button and let the device restart. You will not lose data doing this. It's like a computer reboot.
    2. If that didn't work quite the app again and then delete the app. I'm assuming that the problematic app is not one of the default apps that came on the iPhone. To delete an app tap and hold on the app until it begins to juggle and displays an X. Tap on the X and confirm that you want to delete the app. Then download the app again from the app store. Be sure you back up your data first. You will not be charged to download the app again so long as you are using the same Apple ID that you used to download it originally.
    3. If those attempts still failed contact the developer of the app to determine if they are aware of the problem and whether they have a fix planned for it.

  • [Unknown] Bash: Why does this script break my environment?

    I'm trying to build a script to do a couple makepkg tasks and it looks like I'm having trouble with a function breaking the environment.  The function does several commands and then breaks makepkg.  After I run the script, makepkg runs as if no options are entered:
    makepkg -g
    ==> Check: Installer is the correct size.
    ==> Extracting archive...
    ==> Copying files...
    cp: cannot overwrite non-directory `/var/abs/local/personal/worldofgoo/pkg/usr/share/games/worldofgoo/WorldOfGoo' with directory `WorldOfGoo'
    ==> ERROR: An unknown error has occurred. Exiting...
    Instead of the expected:
    makepkg -g
    ==> Retrieving Sources...
    -> Found worldofgoo.desktop in build dir
    ==> Generating checksums for source files...
    md5sums=('e49849a66aa50065d4d548653a33cc23')
    Here's the script it just started happening when I added the function.  I think it has to do with the curly brackets that awk uses.
    #!/bin/bash
    # mp - makepkg package building tasks
    # Add md5sums following source array in PKGBUILD
    md5add () {
    # Delete previous md5sum entries
    sed -i '/^md5sums/,/).*$/d' PKGBUILD
    # Add md5sums to end if PKGBUILD
    makepkg -g >> PKGBUILD
    # Move md5sums to follow source array
    awk 'BEGIN {
    checkAt = 0
    filesAt = 0
    scanning = 0
    /md5sums=\(/ {
    checkAt = NR
    scanning = 1
    /source=\(/ {
    filesAt = NR
    scanning = 1
    /)$/ {
    if (scanning) {
    if (checkAt > filesAt) {
    checkEnd = NR
    } else {
    filesEnd = NR
    scanning = 0
    lines[NR] = $0
    END {
    for (i = 1; i <= NR; ++i) {
    if (checkAt <= i && i <= checkEnd) {
    continue
    print lines[i]
    if (i == filesEnd) {
    for (j = checkAt; j <= checkEnd; ++j) {
    print lines[j]
    }' PKGBUILD > /tmp/PKGBUILD.tmp
    if [ -f /tmp/PKGBUILD.tmp ]; then
    mv /tmp/PKGBUILD.tmp PKGBUILD
    fi
    # Remove trailing blank lines
    while [ "$(tail -n 1 PKGBUILD)" == "" ]; do
    sed -i '$d' PKGBUILD
    done
    # Options
    case $1 in
    p ) if [ ! -f ./PKGBUILD ]; then
    echo "No PKGBUILD in this directory ($(pwd))"
    exit; else
    makepkg -sf
    fi
    s ) if [ ! -f ./PKGBUILD ]; then
    echo "No PKGBUILD in this directory ($(pwd))"
    exit 1; else
    echo "adding md5sums"
    md5add
    makepkg -f --source
    fi
    * ) # Display usage if full argument isn't given
    echo " ${0##*/} <option> - makepkg building tasks:"
    echo " p - build package (also installs dependencies)"
    echo " s - build source-only tarball (adds md5sums, tars for submission)"
    exit
    esac
    I have to restart to reset the environment (logout doesn't work) so I'l like to be able to fix this .  Any ideas?
    Last edited by Gen2ly (2009-10-30 15:19:17)

    Just reinstalled and not having it come up again.  Putting this in wonderland.
    Last edited by Gen2ly (2009-10-30 15:18:44)

  • Why does this script error on shutdown?

    it's the one from this package: http://aur.archlinux.org/packages.php?d … =1&ID=2885
    http://aur.archlinux.org/packages/oss2j … ck/os2jack
    Although it works good it spouts some ugly error on shutdown(although it manages to shutdown correctly)
    Now i just copied the code from some other script so i don't know what could be wrong. So please, all you bash ppl out there!
    /me makes mental note to read the rest of RUTE linux manual to 'get' this stuff more.

    Well, at a first glance, the script backgrounds the kill command and then checks the return status, which I'm pretty sure doesn't work... so it probably does it's job, but looks as if it's failing.

  • Why does this keep popping up A problem has caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.

    I believe that it is the new update but i want to know how to solve my problem.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT) as you start iTunes, then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
    tt2

  • Why does this script fail with OS X Lion?

    The following AppleScript has been woorking just fine ronning Snow Leopard. Under Lion only the first site is loaded and the other Safari tabs are Untitled. Does anyone know what is wrong and how do I fix it? Thanks for any help.
    Hugh
    ---------------------------------------------------- Non-working script ---------------------------------------------------------------------
    tell application "Safari"
              open location "http://www.macrumors.com/"
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.macworld.com/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.macnn.com/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://reviews.cnet.com/macfixit/?tag=mfiredir"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.macintouch.com/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://arstechnica.com/apple/"}
              tell window 1 to set current tab to make new tab with properties {URL:"http://www.appleinsider.com/"}
    end tell

    Does anyone know what is wrong and how do I fix it?
    Actually, I don't know why your script fails with Mac OS X Lion. I can only suggest the following workaround, which seems to work properly:
    set myURLs to {"http://www.macworld.com/", "http://www.macnn.com/", "http://reviews.cnet.com/macfixit/?tag=mfiredir", "http://www.macintouch.com/", "http://arstechnica.com/apple/", "http://www.appleinsider.com/"}
    open location "http://www.macrumors.com/"
    tell application "Safari"
        activate
        tell window 1 to repeat with thisURL in myURLs
            set current tab to make new tab
            my newTab(thisURL)
        end repeat
    end tell
    on newTab(theURL)
        tell application "System Events"
            keystroke "l" using command down
            keystroke theURL & return
        end tell
    end newTab

  • Why does object frame style change when I re-size the object?

    I am creating a catalog with lots of images that I anchor amidst text.  I have created a simple style that just adds a 1pt black stroke frame, and apply to each. When I later decide to re-size one of the images (primarily by dragging with mouse with CTRL-SHIFT), I notice that the style has been over-ridden, and the frame appears altered. I can then successfully clear the over-ride, but what a pain.  How can I avoid this? Is there a way to "mass" reset many such problems? Like Find/Change, object style, and clear over-ride?

    If you can not see "Adjust Stroke Weight When Scaling" option in the control panel, you will need to enable it first.
    Go to Edit > Menus > Category: Context & Panel Menus > Control Panel Layout Menu and then make sure "Adjust Stroke Weight When Scaling" has an eyeball selected to make this visible.

  • Why does this script only work on mobile devices?

    Is there any reason this conditional statement would work on mobile devices and not in a desktop browser i.e. Chrome, Safari? I am using it in a scroll activated project to trigger a symbol to play forwards or backwards depending on where the playhead is in the symbol. Works great on an iPad but not Chrome, Safari on my desktop.
    if (sym.getSymbol("icons_sym").getPosition("back") ) {
    sym.getSymbol("icons_sym").playReverse();
    else {
       sym.getSymbol("icons_sym").play("front");
    Thanks,
    Mark

    Ivan
    Sorry, my original posting was complete rubbish - I'll try and find the right answer...
    HTH
    Regards Nigel
    Message was edited by:
    nthomas

  • Why does this popup on shutting down my Mac--Continue the installation-.choose abort if you wish to cancel installation

    I am getting this popup when I am shutting my iMac desktop. OSX Mountain Lion. I use Safari. "Continue the installation….choose abort if you wish to cancel installation….then is says "abort and yes"
    I have tried removing InstallMac and anything Geneio from the hard
    drive. Any other suggestions?

    Genieo Adware is installed.  Removing it will help.
    If you have another browser installed, use it.
    If not, launch App store and get another  browser for temporary use.
    Remove it afterwards.
    1. Use  free  AdwareMedic by clicking “Download ” from here
        http://www.adwaremedic.com/index.php
        Install , open,  and run it by clicking “Scan for Adware” button   to remove adware.
        Once done, quit AdwareMedic by clicking AdwareMedic in the menu bar and selecting
        “Quit AdwareMedic”.
                   or
        Remove the adware  manually  by following the “HowTo” from Apple.
        http://support.apple.com/en-us/HT203987
    2. Safari > Preferences > Extensions
         Turn those off and relaunch Safari to test .
         Turn those on one by one and test.

  • The monitor of my MacBook Pro suddenly became all black, I tried to reset but it did not work, what should I do? Why does this happen?

    The monitor of my MacBook Pro suddenly became all black, I tried to reset but it did not work, what should I do? Why does this happen?

    I advise to reply to the one you want to reply to.
    You have had good information here. I will not repeat that here.
    I would like to add:
    you have incompatible software: start in SafeMode, read Woodmeister and see if it is free of issues.
    Akamai is crap software needed or not, Huawei the same.
    It is very possible that the keygenerator you used for generating a key for some softwares has infected your mac.
    The non-regular software with the false key(s) are not compatible probably or generate malware. Luckily you can not update them automatically because the keygenerator blocked the software for contacting the developer... I propose to consider getting rid of those softwares by really good uninstalling.
    You have a beautiful mac, don't degenerate it with crapped software. There are alternatives for expensive software, for example Adobe Photoshop has a free alternative (with a less beautiful interface) in GIMP. And so on.
    Lex

  • HT5007 Why does this app stop at about 10 seconds into a selected trailer then resume on it's own?

    Why does this app stop and resume?

    I believe the OP is asking about the Apple iTunes Movies Trailer app, so it is an Apple app.
    I think maybe the video playback catches up with the download and until the download resumes, the video is stopping. Just a guess at this point.

  • Why does this logo have jagged edges?

    I'm working on a new logo and before I get too far along I need to resolve this issue;  why does this shape have jagged edges when posted on the web?
      you can see it on-line auctionontario.ca
    Thx

    auctioneer,
    Obviously, you are using the transparency available for the GIF format.
    In addition, you should tick the Anti-Aliasing which is, unfortunately, hidden away like a hidden feature in the Image Size window within Save for Web.

Maybe you are looking for

  • Flash player does not work i need help!!

    flash player 10 says it downloads but it doesn't work youtube does but like myspace and facebook doesnt work it still says I need  to install it so I tryed the other way with the zip file and the uninstall and change ActiveX thing and it still doesn'

  • Problem in deploying war file in weblogic application server 10

    Hi           Thank you for reading my post.           We are trying to deploy our application into weblogic but problem is that weblogic return an error like following one when we try to deploy the application.           I should tell you that the fo

  • How to do validation of input fields

    Hi all,           I have a rquirement to do the validation of input fields.Can anybody explain me how to go for that???Please explain in detail.U can also give me a link where i can find the tutorial for doing this.

  • Reorganization of old PIR

    Hi. reorganization of old PIR of single material through MD74 & MD75 is doing well, but how to reorganize the PIRs of product groupwise (like Tablet gr.,Capsule group etc ) in a plant. Regards,

  • Delete Worklist created in Fixed Assets thru AR31

    In Fixed Assets, i created and released an worklist using t-code AR01 and AR31 for Cost Center mass change few days back. I cant manually change any cost center in asset master record for those assets already in worklist and it still shows its status