ExtendScript try/catch difference when script ran from ESTK and Illustrator

Hello,
I've written an ExtendScript for Illustrator using the ExtendScript ToolKit (ESTK).  This scripts works really well when running it in Illustrator from the ESTK (using the target application functionality).
However when I run it directly within Illustrator (by selecting it from the dropdown File > Scripts) I get a run time error.  Is this normal?  Should I expect differences when running the script in these two different ways?
The error is in this function...
```
function itemUsable (arr, item) {
    var usable = true;
    try {
        arr[item];
        usable = true;
    } catch(e) {
        $.global.alert(e);
        usable = false;
    return usable;
```
The point of the code is to get around Illustrator's issue of throwing errors when accessing properties that don't always exist.  Ran from ESTK the try/catch statement catches the error "No such element" and then sets the function to return false.
When ran directly from Illustrator the error message fires but the try/catch doesn't seem to stop the script from exiting.
The only difference I can see is when running the script from ESTK the dropdown menu next to the application target dropdown is always (and has only the option) "main".  Running the script directly from Illustrator, when the error is thrown this dropdown option is set to the value "transient".
See this screenshot for an example what I mean
Any help would be much appreciated.
Thanks,
/t

Thanks Trevor.
So it turns out that a script executed in Illustrator from ExtendScript has a different debug mode compared to a script that is opened directly by Illustrator.  Useful to know.

Similar Messages

  • When I come from outside and press the home button to turn my iPod on, there is white, light blue and red lines but it is transparent enough that I can see my background, time, etc. It hasn't been water damaged, so that cant be the problem.

    When I come from outside and press the home button to turn my iPod on, there is white, light blue and red lines but it is transparent enough that I can see my background, time, etc. It hasn't been water damaged, so that can't be the problem. I was thinking maybe it is just because of the cold but, I don't like having my iPod doing that whenever I come back from the cold. However, I was in class too and this problem happened but it was inside! So I am very worried, I have dropped my ipod a few times but it hasn't fallen that hard to effect it.

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                      

  • My ipad will no longer connect to the laptop. it comes up with usb not recognized. also when trying to connect to the power the first time i connect, nothing, but when i unplug from ipad and plug in a second time it charges

    my ipad will no longer connect to the laptop. it comes up with usb not recognized. also when trying to connect to the power the first time i connect, nothing, but when i unplug from ipad and plug in a second time it charges

    yeah tried all that. the only thing that i havent tried is to delete itunes completely and restart. its the same with the ipad. i havent done a master reset. i just think it has to be something rather simple as it acknowledges that i have plugged in the ipad as it makes the noise it just come up usb not recognized. it shows up as an unknown device that doestn have  any drivers
    its driving me round the bend at the minute

  • I bought the pack for students adobe creative cloud, already made the payment three days ago but when opening programs like photosop and illustrator puts the trial period has expired, how I can make them work?

    I bought the pack for students adobe creative cloud, already made the payment three days ago but when opening programs like photosop and illustrator puts the trial period has expired, how I can make them work?

    Hello Ibonedm,
    Sol 1. Please try sign out from Creative cloud Desktop App and quit it.
    1. Launch Creative Cloud application manager.
    2. Click the gear icon in the upper-right corner and select Preferences.
    3. In the Preferences menu, under General, click the Account tab.
    4. Click Sign Out from Creative Cloud.
    Then re-sign in and launch Photoshop CC 2014 and check.
    Sol 2. Check your Hosts file.
    Windows
    1. Choose Start > Run, type %systemroot% \system32\drivers\etc, and then press Enter.
    2. Locate Hosts file and move it to Desktop
    3. Right-click the hosts file and select Open. Select Notepad for the application to open the hosts file.
    4. Back up the hosts file: Choose File > Save As, save the file as hosts.backup, and then click OK.
    5. Search the hosts file for entries that reference activate.adobe.com (for example, 127.0.0.1 activate.adobe.com) and delete these entries.
    6. Save and close the file and move it back to Etc folder.
    Mac OS
    1. Log in as an administrator to edit the hosts file in Mac OS.
    2. In a Finder window, choose Go > Go To Folder.
    3. Type /etc.
    4. Select the hosts file and move it on Desktop  open it.
    5. Back up the hosts file: Choose File > Save As, save the file as hosts.backup, and then click OK.
    6. Search the hosts file for entries that reference activate.adobe.com (for example, 127.0.0.1 activate.adobe.com) and delete these entries.
    7. Move Hosts file back to etc folder
    8. Save and close the file.
    Then try launching Photoshop CC 2014 or Illustrator CC 2014
    If prompt for License this software, please click on it and sign in with the Adobe ID and Password which you have used to purchase the subscription and check if you can activate and use the products.
    Please respond , if any issue.
    All the best
    Loveneesh.

  • ITunes freezes when importing music from CD and also when playing,

    Just recently iTunes has started to freeze when importing music from a CD - it just stops and the progress bar remains as it it. The whole mac then freezes and I get the spinning beachball. I can't use any other application. The same thing is happening when I play music - it's ok for a song or two and then freeze and the beachball appears. I've downloaded iTunes again and reinstalled and it's just the same. Using Safari and Mail etc is no problem at the moment.
    I also have a problem getting the iMac to recognise external hard drives - it won't show them on either firewire 400 or 800. I can see my 1TB drive using usb ( it shows up on the desktop, whereas on firewire it doesn't do this) but if I try to open it and see the contents in finder, it opens, but doesn't dispaly the contents of the drive. I can see the disk size but just get a grey spinning wheel in the bottom right hand of the finder window. Timemachine does not work.

    I have had the same problem & itunes crashes when i try to import a file. Now i can't even start itune. I've reinstalled itunes so many times, without a fix, I've lost count.
    I did post and had no reply. I'll watch this post with interest.

  • Script runs differently from ESTK and Scripts panel

    Recently I was reported about a problem with one of my scripts, that packages ID documents: a guy wrote me that when he runs it from ESTK, script works fine, but when run from Scripts panel — creates empty folders, does nothing more but generates an error (there's an error handler in the script that logs errors into a text file):
    Error: Invalid value for parameter 'versionComments' of event 'packageForPrint'. Expected String, but received TRUE.
    It's strange, because I don't use this optional parameter in the script.
    BTW, on my computers it works ok, both in ID and ESTK.
    Does anybody encountered this problem? Any ideas on why this happens?
    Kasyan

    He probably has his scriptPreferences version set to 5. To make your script foolproof, you should probably set the scriptPreferences yourself (and restore them when you are don to be nice...)
    BTW, kAppVersion = parseFloat(app.version) is a more readable form for getting the version number...
    Harbs

  • Does a DAC make a lot of sound difference when connected between an iMac and a good receiver?

    I have one of the better Yamaha receivers plus two Cerwin-Vega bookshelf speakers plus an Infinity sub that sound pretty good playing the AAC(mostly 256) files on my iMac. I've heard that a DAC can really make a difference. Can anyone confirm that and possibly even make a DAC recommendation?

    The DAC manufacturers and, I am sure, enthusiastic audiofiles, will make all kinds of claims that an external DAC makes a huge difference.   I urge some caution however because you would necessarily also have to have high end audio equipment (amp, speakers & wiring) as well as a near-perfect environment (studio, anyone?) in order to hear a meaningful difference just because of the DAC.   It's not just a matter of having a DAC, it's the entire audio setup that makes the difference.
    IMHO if your system is at home and you have a reasonably good amp & speakers, the analog output from your Mac will deliver excellent performance and you would be hard put to discern a difference by putting a DAC in the audio chain.  At least, that's been my experience.
    Also, if your Yamaha amp has optical digital input, you can connect it directly to your Mac's audio out (combined headphone + optical digital output) ... without needing a separate DAC.

  • Differences between a macbook from UK and Germany?

    Are there any differences between a macbook pro 15 from UK and Germany except the different keyboard layout and the power adapter ?

    jimfromberlin,
    the duration of the seller’s warranty is probably shorter in Germany than in the UK. (The duration of the manufacturer’s warranty is identical.)

  • My Content/text/code is being deleted when selected in Dreamweaver, Photoshop and Illustrator

    FOr the past week when I select text in photoshop and illustrator, or code in dreamweaver, it is deleted.  I've updated all apps and uninstalled and reinstalled dreamweaver but nothing seems to work.  Is this an app issue or a mac issue?  Its only happening with adobe products.

    Have you asked in the specific forums for those programs?
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right to open the drop down list and scroll

  • KDE difference when starting programs from desktop or button

    This is very strange. I'm using KDE 3.5.4 from normal Arch packages.
    I've noticed that Firefox (installed from mozilla.org, not package) looks different when started from the desktop icon, than when started from the kicker button. The desktop icon is a 'Link to application'.
    The kicker button is a 'Non-kde application'.
    I wondered how it can look different, so I started each copied the process environment to a file of both (one after the other)*. I compared the environments and the interesting this is, one has
    DISPLAY=:0
    the other has
    DISPLAY=:0.0
    but that's not so important.
    The one started from the desktop has GTK2_RC_FILES and GTK_RC_FILES set, the one from kicker didn't have them. The one started from the desktop also had  ~/.kde/share/config/gtkrc-2.0 in GTK2_RC_FILES and this was actually what caused the difference in the firefox look.
    After I removed that file, now Firefox looks the same in both cases - the way I set it up with gtk-theme-switch2 (and some personal corrections in ~/.gtkrc-2.0).
    NOW, is this a BUG a FEATURE or what? Also,
    - can anyone else see this behaviour?
    - can anyone check in other KDE versions?
    - in other distributions?
    * The commands I used, in case anybody needs it:
    cat /proc/PID/environ | xargs -0 -n1 | sort > firefox-env.desktop
    cat /proc/PID/environ | xargs -0 -n1 | sort > firefox-env.button

    You could try repairing the permissions while the drive is in the computer. After that, try ejecting it to see if everything is back to normal. an alternative you could try first is to relaunch the Finder from the force quit menu.

  • Results table difference when running query from Alert compared to Query Manager

    Hello,
    I have following query - Aim is to create alert to tell employee which customers to make visit to in next 4 weeks
    SELECT DISTINCT T1.CardName, T1.U_VisitDue, T1.U_VisitReason, T1.U_Priority, T1.U_Region as 'Area', T1.U_VNotes
    FROM dbo.OCRD T1
    WHERE DateDiff(d,T1.U_VisitDue, GETDATE()) <29
    Group BY T1.CardName, T1.U_VNotes, T1.U_VisitDue, T1.U_VisitReason, T1.U_Priority, T1.U_Region
    FOR BROWSE
    My problem is that when I run query through alert the field U_VNotes is displayed differently.
    Running the query from Query Manager the contents of this field appear in one field of the result table.
    Running the query via Alery the content of this field is split into several fields in results table according to 'new line' in field entry.
    This makes the results table from the Query less 'user-friendly' because if you want to sort the table by 'Date' column for example it makes a mess of the table because of the extra rows.
    I want results table to look like top version in picture below ... but i want to run from alert.
    Is this possible?
    How can I achieve it?
    Thanks for any assistance
    Regards, Karen

    Hi
    check this support note:1774628 The SQL SELECT DISTINCT Statement does not work in ALERTS
    Kind regards
    Agustín Marcos Cividanes

  • Ordering of rows are showing difference when migration db from 9.2.0.8.0-32bits(windows 3) to 10.2.0.5.0 - 64bit(windows 8)?

    Dears,
    After migration(via export/import), we are facing ordering of rows are mis-match  in these two databases.
    the following same query I am running on the these two databases. but different output. output are below.
    [CODE]
    SELECT ROWNUM AS RowNo, TBL1.*
      FROM (    SELECT COUNT (PG_ID) AS TotalCount,
                     PG_DESC AS PageDescription,
                     CURR_EPR_QUEUE AS CurrentQueue,
                     PG_NME AS PageName,
                     QUEUE_TYP_CDE AS QueueTypeCode,
                     PG_ID AS PageID
                FROM SASV_TB_CNT_APPL_JUDG_2----this is a view
               WHERE (CURR_EPR_QUEUE = 'test' AND QUEUE_TYP_CDE = '01')
                     OR (    JUD_RACIF_ID = 'test'
                         AND CMPLTD_IND = '0'
                         AND DSPLY_IND = '1')
                        AND TOTAL_CNT > 0
            GROUP BY PG_ID,
                     PG_NME,
                     PG_DESC,
                     CURR_EPR_QUEUE,
                     QUEUE_TYP_CDE            
                      ) TBL1
    [/CODE]
    output- from
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    TNS for 32-bit Windows: Version 9.2.0.8.0 - Production
    1
    7
    Other Documents(Hearing)
    askinj
    HG01_Other_Documents
    1
    HG01-TB02
    2
    3
    Pending Award
    askinj
    HG01_Pending_Order
    1
    HG01-TB05
    3
    19
    Motion(ADR)
    askinj
    MD01_Motion
    1
    MD01-TB01
    4
    5
    Other Documents(ADR)
    askinj
    MD02_Other_Documents
    1
    MD01-TB02
    5
    1
    Scheduling(ADR)
    askinj
    MD01_Scheduling
    1
    MD01-TB03
    6
    8
    Mediations
    askinj
    MD01_Mediations
    1
    MD01-TB04
    output from--
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    1
    3
      Pending Award
    askinj
    HG01_Pending_Order
    1
    HG01-TB05
    2
    7
      Other   Documents(Hearing)
    askinj
    HG01_Other_Documents
    1
    HG01-TB02
    3
    8
      Mediations
    askinj
    MD01_Mediations
    1
    MD01-TB04
    4
    5
    Other Documents(ADR)
    askinj
    MD02_Other_Documents
    1
    MD01-TB02
    5
    1
    Scheduling(ADR)
    askinj
    MD01_Scheduling
    1
    MD01-TB03
    6
    19
    Motion(ADR)
    askinj
    MD01_Motion
    1
    MD01-TB01
    the views query is below
    SASV_TB_CNT_APPL_JUDG_2
    [code]
    (SELECT spm.PG_ID,
               spm.PG_NME,
               spm.PG_DESC,
               DECODE (TAJD.ABS_IND, 1, GUEST_JUD_ID, JUDG_ID) CURR_EPR_QUEUE,
               QUEUE_TYP_CDE,
               1 "TOTAL_CNT",
               DECODE (TAJD.ABS_IND, 1, GUEST_JUD_ID, JUDG_ID) JUD_RACIF_ID,
               CMLTD_IND CMPLTD_IND,
               NULL DSPLY_IND
          FROM SA_PG_MSTR SPM, TMST_APPEAL_JUDGE_DETAIL TAJD, SA_WRK_ITM SWI
         WHERE     SWI.WRK_ITM_ID = TAJD.WRK_ITM_ID
               AND swi.tb_pg_id = spm.pg_id
               AND SWI.CURR_EPR_QUEUE = 'AppellateCommonJudgeUser'
               AND CMLTD_IND = '0'
               AND tajd.LEAD_JUD_IND != '3'
        UNION ALL
        SELECT spm.PG_ID,
               spm.PG_NME,
               spm.PG_DESC,
               CURR_EPR_QUEUE,
               QUEUE_TYP_CDE,
               1 "TOTAL_CNT",
               CURR_EPR_QUEUE judg_racif_id,
               '0' CMPLTD_IND,
               NULL DSPLY_IND
          FROM SA_PG_MSTR spm, SA_WRK_ITM SWI
         WHERE SCCS_IND = '1' AND SWI.ACTIVE = '1' AND spm.pg_id = swi.tb_pg_id
        UNION ALL
        SELECT spm.PG_ID,
               spm.PG_NME,
               spm.PG_DESC,
               CURR_EPR_QUEUE,
               QUEUE_TYP_CDE,
               1 "TOTAL_CNT",
               JUD_RACIF_ID,
               CMPLTD_IND,
               DSPLY_IND
          FROM ST_WRK_ITM_JUD_DTL SWIJD, SA_WRK_ITM SWI, SA_PG_MSTR spm
         WHERE     SWI.WRK_ITM_ID = SWIJD.WRK_ITM_ID
               AND swi.tb_pg_id = spm.pg_id
               AND swi.queue_typ_cde IN ('01', '05')
               AND swi.dup_ind <> 1);
    [code]
    parameters in 9i are belows
    [code]
    aq_tm_processes    1
    background_dump_dest    D:\oracle\admin\TEST\bdump
    compatible    9.2.0.0.0
    cursor_sharing    similar
    db_block_size    8192
    db_cache_size    947912704
    db_domain
    db_file_multiblock_read_count    16
    db_keep_cache_size    167772160
    db_name    TEST
    fast_start_mttr_target    300
    hash_area_size    1073741824
    hash_join_enabled    TRUE
    instance_name    TEST
    java_pool_size    67108864
    job_queue_processes    10
    large_pool_size    109051904
    local_listener    (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.51)(PORT=1521))
    log_archive_format    %t_%s.dbf
    log_archive_start    TRUE
    log_buffer    26214400
    open_cursors    700
    optimizer_index_caching    80
    optimizer_index_cost_adj    20
    optimizer_mode    FIRST_ROWS
    pga_aggregate_target    1468006400
    processes    800
    query_rewrite_enabled    TRUE
    remote_login_passwordfile    EXCLUSIVE
    session_cached_cursors    400
    sga_max_size    2149134244
    shared_pool_size    788529152
    sort_area_size    1073741824
    star_transformation_enabled    FALSE
    timed_statistics    TRUE
    undo_management    AUTO
    undo_retention    10800
    undo_tablespace    UNDOTBS1
    utl_file_dir    H:\ICMS_TO_GO
    workarea_size_policy    AUTO
    [code]
    parameters in 10 are belows
    [code]
    aq_tm_processes    1
    compatible    10.2.0.5.0
    db_block_size    8192
    db_domain
    db_file_multiblock_read_count    16
    db_name    TEST
    db_recovery_file_dest    C:\oracle/flash_recovery_area
    db_recovery_file_dest_size    171798691840
    dispatchers    (PROTOCOL=TCP) (SERVICE=TESTXDB)
    job_queue_processes    10
    log_archive_format    ARC%S_%R.%T
    open_cursors    800
    open_links    10
    open_links_per_instance    10
    pga_aggregate_target    3984588800
    processes    1200
    recyclebin    OFF
    remote_login_passwordfile    EXCLUSIVE
    session_cached_cursors    400
    sessions    1325
    sga_max_size    10485760000
    sga_target    10485760000
    undo_management    AUTO
    undo_tablespace    UNDOTBS1
    utl_file_dir    H:\ICMS_TO_GO
    optimizer_dynamic_sampling    2
    optimizer_features_enable    10.2.0.5
    optimizer_index_caching    80
    optimizer_index_cost_adj    20
    optimizer_mode    FIRST_ROWS
    optimizer_secure_view_merging    FALSE
    plsql_optimize_level    2
    [code]
    where can we look into for this issue? actually we need rows will be the same ordering as it was in 9i.
    we are facing this problem in lot of queries, this is a sample one.
    Regards
    Halim

    Hi Jgarry,
    why do you need a particular physical order?
    Actually i don't know the .net application behave or code yet . but after migration, I am facing this issue.
    one more thing we changed the server machine so Is there any registry parameter (in windows) related to this. Have you any idea.
    the application is running since 8 years and I think nobody can rely on implicit data distribution arising from how the data is entered to develop a application.
    Hi Hoek,
    According to Oracle White Paper(page 17), If I change below parameter. Is there any hope to get same order.
    "After you upgrade to Oracle Database 10g, if you
    wanted to revert back to 9.2 optimizer behavior you can set
    OPTIMIZER_FEATURES_ENABLE = 9.2.0 "
    Regards
    Halim

  • Whenever I play music only one of the speakers on the bottom (the right one) seems to play the music, if i cover each speaker one at a time you hear no difference when i cover the left, and then you hear no music when i cover the right... help?

    bottom left speaker isnt working...
    i tested it out and im not sure if its suppose to be like this or not.
    when i play my music i tried covering the left speaker on the bottom and no sound difference occurred, then when i covered the bottom right one i heard nothing just some sound from under my finger. the left speaker isnt working or it happens to act like that on 2 of my friends too...
    help?

    Only one of them is the speaker (bottom right), the other one is the microphone

  • Office O365 prompting for credentials when opening files from OneDrive and selecting "Edit in Word"

    When logged into my OneDrive IE 9 and select a word or excel file to  "Edit in Word" or "Edit in Excel"I get prompted with the following Sign In message. 
    "Call us overprotective, but we need to verify your account again before opening this document."  
    When I enter my live ID and password it then asks again for my user ID and then password over and over and I can never open the document to edit in my local copy of Word or Excel 2013.
    I have done the basic internet troubleshooting and deleted all my temporary internet files. I have also re-installed MS office 2013 from my O365 account without issue. 
    Any help on this would be greatly appreciated.
    Thanks Much. 

    Hi,
    I've seen this issue on Office 365 Community before, it should be like:
    Some users resolved the issue by pressing the Enter key instead of clicking on the Next button, try if this works for you.
    You can also try with another Web Browser if you have, if with another browser it works fine, consider to reset the Internet Explorer:
    Internet Options -> Advanced -> Reset Internet Explorer Settings -> Reset.
    Let me know if you need further assistance.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Error message when creating PDF from Indesign and Photoshop

    Hi, I reinstalled my Adobe CS2 product, and now get an error message each time I create a PDF from either InDesign or Photoshop. The message reads:
    The instruction at "0x0045c9e5" referenced memory at "0x0215ebdc". The memory could not be "read".
    I appreciate any help in resolving this issue.
    Thanks --Alex

    How do you create the PDF? There are multiple ways and it might make a difference.

Maybe you are looking for

  • How do I backup my emails in Mail Mountain Lion?

    Am running an IMAP email from my website webmail (hosted at oneandone.com) to Mail on my iMac and am now running out of space on my webmail and so won't be able to receive any new emails when my space runs out.  As the email system is IMAP, if I dele

  • Unable transform,source XML is null

    Hi , I have the following transformation and the input xml as below. When i test it in jdeveloper , it's giving "Unable transform,source XML is null". On the traget XML , there is no data and the error is " Document has no root element ,start of root

  • Outlook Calender sync fails despite mobile.de

    I've got membership to mobile.me and treid to sync my outlook (2003 - windows XP)with mobile.me for my new iPhone 4. Nothing happens? The contacts are OK. What is wrong? Thanks for your support and best regards Ronwa

  • No way to add images for story-boards to the project?

    Apparently, in all the Great Ideas on building this program (sarcasm included free) no one thought about perhaps "sharing" things other than "documents". So ... got an image on your local computer you want to add as a story-board image? Fuhgedaboutit

  • Strange Calendar sync problem after migrating to iOS5

    Hello all, I posted my problem as an "me too" reply to somebody else's thread but think it got a bit lost there. Since I can't solve this problem I decided to make a new thread. The problem: After upgrading my iPhone4 to iOS5 I have a strange calenda