Modified a script and now it stops in middle

Hi,
I'm learning Applescript slowly and I need an expert's help. I'll take anyone's help, actually.
I modifed a script a coworker wrote. (He moved away or he'd have it finished by now.) I added a new printer preset to a script that automatically names a document in InDesign a specific code that you tell it to by typing in info in dialog boxes. I was very careful in making sure everything matched with my addition. It works with the first dialog box that sends a page separately. However when I need to send several pages at a time, it goes through all the dialog boxes, but then when it's time to name and print, it stops cold. It's a huge script so I will insert samples.
First, here's a section of what I added:
if (count of page_names) < 6 then
set column_1 to make dialog column
tell column_1
set printbutton_group_1list to {}
repeat with i from 1 to (count of page_names)
set the_page to (item i of page_names) as string
set the_panel to make border panel
tell the_panel
make static text with properties {static label:the_page}
set printbutton_group1 to make radiobutton group
tell printbutton_group1
make radiobutton control with properties {static label:"Color (Merge)"}
make radiobutton control with properties {static label:"Color (Direct)"}
make radiobutton control with properties {static label:"Black & White"}
make radiobutton control with properties {static label:"BW Ads (Merge)"}
make radiobutton control with properties {static label:"Do Not Print", checked state:true}
end tell
set printbutton_group_1list to printbutton_group_1list & printbutton_group1 as list
end tell
(I added the radiobutton for "Bw Ads (Merge)" preset) It goes through all the possible column combinations, which I carefully added the preset to, also.
Next, I designated the button to it's preset:
--retrieves information from Multi Dialog Box
if checked state of proofdocbox is false then
set multipresetlist to {}
set discludepagelist to {}
if (count of page_names) < 6 then
repeat with i from 1 to (count of page_names)
if selected button of item i of printbutton_group_1list is 0 then
if selected index of proof_menu is 0 then
set selected_preset to "FBEx1_Merge"
else if selected index of proof_menu is 1 then
set selected_preset to "FBEx2_Merge"
end if
set multipresetlist to multipresetlist & selected_preset
else if selected button of item i of printbutton_group_1list is 1 then
if selected index of proof_menu is 0 then
set selected_preset to "FilmBMx1EAE"
else if selected index of proof_menu is 1 then
set selected_preset to "FilmBMx2EAE"
end if
set multipresetlist to multipresetlist & selected_preset
else if selected button of item i of printbutton_group_1list is 2 then
set selected_preset to "WideSingle B&W Composite"
set multipresetlist to multipresetlist & selected_preset
else if selected button of item i of printbutton_group_1list is 3 then
set selected_preset to "Black White Ads"
set multipresetlist to multipresetlist & selected_preset
else if selected button of item i of printbutton_group_1list is 4 then
set discludepagelist to discludepagelist & item i of page_names
end if
end repeat
(Again, it goes through all the columns.) Now here's where I think it stops:
--Final Print Loop (Names File / Prints)
if (pub_valid is true) and (pagenumvalid is true) and (sectionletterinvalid is false) and (broken_link is false) then
set failedto_printlist to {}
repeat with i from 1 to printpageloop
if publication is "Regional" then
set reg_edition to true
else
set reg_edition to false
end if
--If printing multiple pages, defines page specific information
if checked state of multi_box is true then
if InDesign_Letter is true and proof_doc is false then
set selected_preset to item i of finalpresetlist
set rawpagename to item i of pagerangelist as text
set pagetoprint to rawpagename
set section_letter to first character of item i of sectionletterlist
if section_letter is "B" then
set zone_page to true
else
set zone_page to false
end if
set pagenumonly to sblib's extractnum_from_string(raw_pagename)
set twodigit_pagenum to sblib's makenum_two_digits(page_numonly)
else if InDesign_Letter is false and proof_doc is false then
set selected_preset to item i of finalpresetlist
set rawpagename to item i of pagerangelist as text
set pagetoprint to rawpagename
if section_letter is "B" then
set zone_page to true
else
set zone_page to false
end if
set pagenumonly to sblib's extractnum_from_string(page_toprint)
set twodigit_pagenum to sblib's makenum_two_digits(page_numonly)
else if proof_doc is true then
set pagetoprint to (item i of page_names) as string
set pagenumonly to sblib's makenum_two_digits(page_toprint)
end if
set inputpage_numuc to ""
set broken_link to sblib's checklink_status(input_page_numuc, pagenumonly, pagetoprint)
end if
tell application "Finder" to activate
tell application "Finder" to delay 2
tell application "Adobe InDesign CS2" to activate
Any thoughts? I appreciate your help.

Just sent you an updated version ....I used section 6 ....your issue was in using [] in a javascript expression. That notion signifies an array notation to javascript, so you must wrap the expression in an xfa.resolveNode("string that represents the expression").....or change over to formcalc where the [] are allowed.
Paul

Similar Messages

  • I recently upgraded to Mavericks and the time machine is failing to backup.  Time Machine began only backing up twice a day and now has stopped.

    I recently upgraded to Mavericks and the time machine is failing to backup.  Time Machine began only backing up twice a day and now has stopped.

    This is the error message I got:
    2014-03-18 17:02:30 -0400 com.apple.backupd[4971]: Error: (22) setxattr for key:com.apple.backupd.HostUUID path:/Volumes/TOSHIBA EXT/Backups.backupdb/Quincy’s iMac size:37
    2014-03-18 17:02:30 -0400 com.apple.backupd[4971]: Backup failed with error 2: 2

  • This content requires hdcp for playback.  so I paid $100 for it and now they stop it from working?

    I have an atv 2, my tv uses componet, I have used it to rent and watch movies on it for a year at least but now it says this content requires hdcp for playback.  so I paid $100 for it and now they stop it from working?
    I also have the first atv, I get the same message

    lol, I had to go look at the back of that, I've been using it so long with componet. I started getting the hdcp message a few months ago on it. been using it for years with componet now I cant.  what I meNt on the AT2 is that when I bought it, I was able to use it, rent moves, etc. since I got it using an adaptor because of my tv. It just recently was rendered incapable along with the componet output on the AT1.
    My tv is a 65"  Hitachi rear projection,  with no hdmi. It's old, but still has a great picture

  • Secure Zone Login Issues:  It worked great and now just stopped.

    The secure zone on my client's site worked great for about a month and now it just stopped.  All of a sudden it won't let us type into the username and password boxes.  We can click on the "remember me" button and the "submit button" but not type.  I've tried deleting and redoing the code and still nothing.  Our issue is occuring most when used with Chrome's browser.  Any thoughts or suggestions?

    Thanks for your reply, Liam.  Oddly enough I was just reading your expectional contributor profile that popped up in my side collumn.
    Here is the link to the site.  The login works fine in Safari, it's just a problem with Chrome I believe.
    www.myadvancedpt.com
    The login area is in the bottom right of the footer titled "Employee Login."

  • I can't reactivate my java script,and now i can't play my apps on face book

    it was suggested by a mozilla pop up that i deactivated javascript,due to a pop up saing that the plugin was slow.to stop the pop up.i did that,and now i can't use apps on my facebook site due to they need javascript.it was free to disable it ,why am i being directed to REGISTER TO REG CURE PRO to pay to fix it? I followed the directions,and still no fix.

    First of all, any registry program is not good for your system, check for malware as i see some malware addons you need to remove.
    USE ALL PROGRAMS LINKED BELOW, YOU MAY MISS MALWARE IF YOU PASS OVER A PROGRAM. The caps are not for yelling but if you miss or dont use all the programs you may miss something, it is to get your attention.
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Also make sure youre not getting Java and Javascript mixed up, they are very different.
    * http://kb.mozillazine.org/JavaScript_is_not_Java
    AND SEE
    * the [[Warning Unresponsive plugin - What it means and how to fix it]] article

  • Yogurt spilled on my macbook air and now sounds stopped working. Pls help

    Hi!
    So mac and yogurt were inside my bag and the yogurt's lid accidentally opened getting into my mac's charger, usb and headphones port. I tried turning it on and everything seemed fine, sounds and the heaphone port were both working but the usb port wasn't so i just wiped away the yogurt. After wiping everything I could see off, i tried connecting my mac to the power and it's working. Usb port not working tho and the sound stopped working, tried connecting a headset and still not working. Those seem to be the only problems. Right now my mac's open and standing to it's side near the heater to dry. What should I do? :(

    Right now my mac's open and standing to it's side near the heater to dry.
    Yes, everyone tries the "dry it out" method, doesnt work,... when it does 'work' it works for a while until corrosion sets in.   Make a service call.
    Liquid spills, why your MacBook chassis is a one-way valve for spills
    After a substantial spill many people will turn their notebook upside down and shake it, not only does this not work, but it spreads liquid havoc throughout your machine and makes things often as bad as possible.
    The keyboard itself acts like a one way valve in the case of a substantial liquid spill. While liquid pours into the bottom chassis easy, it does not come out easily at all, and in the case of any spill, most of it will not come out by turning it upside down. Disconnect all power and contact Apple for diagnostics and repair.
    Do not attempt to, after a spill, ‘dry out your MacBook’ and test it
    After a spill most people invariably try to “dry out” their notebook by various methods, including hair dryers and otherwise. This both does not work, and after a substantial spill of any magnitude, even if the liquid was water, residue is left behind.
    There are additionally many very tight places inside your notebook where liquids will linger for a very long time, and cause corrosion or worse.
    Immediately unplug your notebook and contact Apple for in shop diagnostics and parts replacement.
    In the case of very minor spills people will “dry out” their notebook and feel success that their notebook is working ok, however invariably in nearly all instances after 4-14 days an error / fault pops up and is usually followed by more.
    In case of a spill, damage estimates are impossible,.....anything can be fixed, without question.......the question is cost.
    contact Apple for in shop diagnostics and cost estimation ....possible parts replacement.  

  • Updated itunes to 12.1.1 and now its stopped working

    I just updated iTunes to 12.1.1 on my laptop as it prompted me to and now it just wont work if it loads at all it becomes unresponsive when i try to connect ipad or iphone.
    I have uninstalled it and reinstalled it and it still the same i cant seem to go back to the old version so im now stuck on what to do.
    Any ideas
    Thanks

    Good Afternoon sjwoods83,
    The resources below will help troubleshoot the issue you are having with iTunes for Windows being unresponsive since the software was upgraded.  You may need to uninstall other components in addition to the actual iTunes application.  It's also possible that antivirus software may be affecting iTunes.  Click on the link below for complete details.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues - Apple Support
    http://support.apple.com/en-us/HT203206
    I hope this information helps ....
    - Judy

  • Modified plist file and now  "Contents: (null) Version ? (Build ?)"  Help!!

    I was trying to trick mac into thinking it had newer operating system so I could activate Iphone. Now it does not think it's 10.3.9 so skype and firefox no longer function. Please help!

    You could try downloading and re-running the [Mac OS X Combined Update 10.3.9|http://www.apple.com/downloads/macosx/apple/macosx_updates/macosxcombine dupdate1039.html].
    If the file you modified was
    /System/Library/CoreServices/SystemVersion.plist
    then you could also try using [Pacifist|http://www.charlessoft.com] to selectively re-install just that file from the MacOSXUpdateCombo10.3.9.pkg.
    Message was edited by: jsd2

  • In Process of Backing up 459.29 GB on a external hard drive from my iMac, it backed up 24.87 GB and now has stopped backing up and I have a color pinwheel turning for the past hour... what should I do?

    Help with Time Machine for iMac.... Trying to back up iMac on to 2 TB external Hard Drive... it backed up 24.87 GB or the 459.29 GB and stopped.... now have a pinwheel... should I start over or let it work through?

    Please read and use Time Machine FAQs & Time Machine Troubleshooting. If those do not solve your problem then please repost in the version of OS X you are using. Time Machine is part of OS X therefore you will find the most information for it there. For example if you are using Snow Leopard then use that forum.
    Also when posting it's critical we at least know what version of OS X is installed on your iMac. Please complete your profile in the Your Stuff link above. 

  • Updated and now Itunes stops responding

    I had just finished organizing my library and I was asked if I wanted to update itunes. So I did. I got it installed, started it up, and half way through "updating itunes library" itunes freezes and stops responding. I tried multiple times to no avail. So I uninstalled itunes and redownloaded it. Now when I try to add music to my library, itunes stops responding. What is the deal? Is there anyway I can get an older version of itunes?
    Dell Xps   Windows XP Pro  

    i had the same problem
    tried several times and found some good suggestions on these forums but still no joy
    tried installing version 7.3 which got released but still the same
    i reinstalled an older version of itunes (7.1) and the problem was gone so gonna stick with this for a while
    use the followind url to get the older versions
    http://www.filehippo.com/download_itunes/?2655
    hope this helps

  • HT1725 Paused a download then resumed and now song stops playing halfway through

    I downloaded an album from iTunes Store and one song was going to take 2 hrs to download so I paused the download and then restarted it and it worked. But now when I play that song it stops about 2 minutes into it and skips to the next song. Please help?

    Delete and redownload.
    You do not pay for redownloads.  Follow the direction:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I have an iPod Touch 4G and I still have iOS 5.1.1 and the Wifi says it is unable to join the network and my little brother has the same but iOS6 on his, his works fine no problems with the Wifi router! It was working fine yesterday and now it stopped!!:(

    It was fine yesterday, this morning got up to do what I usally do, Shut down on me
    Called Apple 3 times followed thier instructions (Wifi Troubleshhot and Connectivity) EVERYTHING now its garbage!
    I know I can get a protection plan but my mom said thier was no need for one because of the price!
    Ive tried updating it...It said it needed wifi!
    Dont know! Feel screwd up at this point Can any one help me???!!! It is also a year old! Got it in January and It has not lived to its first birthday!!!:'(

    If you have not taken the iPod apart, Apple will exchange it for a refurbished one for $99. You can do it an an Apple store
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar
    Or sent it to Apple

  • Tried to update iphone via itunes and now all stopped working

    So, after some issues with drivers over the weekend, I decided today to finally update iphone.
    Attached phone to laptop, started upgrade.
    Now it has completely frozen with the itunes icon on the screen alongwith a usb cable.
    According to itunes the phone is in recovery mode and needs to be restored prior to anything else.
    But it simply won't do anything. It has lost and since found the driver again, itunes is working, phone is frozen.
    Apparently the best driver is installed.
    Going to work now, so will check in later.
    Cheers all.
    G

    You will have to restore. If the option is there or available forst back up your device to itunes. After the backup is complete you may backup from restore. This will restore your device whilst at the same time keepin all of your previous data. nothing will be wiped off.

  • A/C adaptor on my Airbook  was working intermittently and now has stop providing juice. Any ideas what the problem might be and any ideas how to fix it.

    A/C adator has stopped working. Any ideas what could be the reason and how to fix it.

    The 'fix' is a replacement if the one you have is faulty.  Bring the MBA and charger to an Apple store genius bar for a free evaluation.
    Ciao.

  • I wanted to listen to WNPR radio through Safari and now cannot stop it. Everytime I open Safari the radio starts again.

    Was listening to NPR and closed Safari but now every time I open Safari NPR comes on again streaming the audio. Only way I can use Safari is to turn MacBook volume all the way down.
    Any suggestions?

    In System Preferences > General, make sure "Close windows when quitting applications"
    is chosen.
    Message was edited by: mr da

Maybe you are looking for

  • DSO to Cube Delta Failure

    Hi All We appear to have a major problem. Yesterday the invoice delta from DSO to Cube failed. My colleage traced the problem to invalid characters in the PSA. However it had loaded successfully into the DSO (I dont know why cos it usually fails into

  • What is Skype trying to hide?

    I've had a problem with incoming calls for some time; some ring through, others don't. I only find out about the missed calls when I get emails telling me I have voicemail, though the actual voicemail doesn't usually appear in Skype until much later

  • Data type conversion in oracle 9.2.0.8

    Team, can we convert oracle 9.2.0.8 LONG RAW and LONG to lob types in oracle 9.2.0.8 Thanks, Aj

  • Current Fiscal Year

    Hi, Is there an oracle function that returns the current fiscal year in format (2012/2013)? Thanks

  • Head swapping in elements 10

    in elements 10 can I view 2 photos  side by side and select & drag a head from one to the other (like I used to in photoshop 7)?  I can't figure it out...help!  Mr.T