AI Plugin: Window resizes after the save!!

Hi Everyone,
I am working on AI plug-in which saves AI file after some validation (E.g.: Checking of Art Board Dimensions, Font n so on.) While saving the AI document, it spawns a jsx file in order to perform the validation. It saves normally if it passes the validation, but it also resizes the window along with the save. I'm unable to figure out what exactly is causing the window to get resized. I have even tried saving the ai file without spawning the jsx script, it still occurs. When I don't use the Plugin it doesn't cause the window to be resized. Please help me in fixing this issue.

Illustrator Version: CS3
Platform: Windows XP
Visual Studio 2008
I observed one thing, it's not the javascript code which is causing the issue, but its _spawnvp function  in the illustrator sdk(vc++ code) itself. If the applicaion window isn't maximised, it'll remain the same, only when it's maximised it tries to resize the window.
This is how I am spawning a new thread for saving the file. As i said earlier, .jsx file does some validation as well.
VC++ Code:-
sprintf_s(pathToJs, 1024, "%s\\%s.jsx", scriptPath, formatName);
    args[0] = applicationPath;
    args[1] = pathToJs;
    args[2] = NULL;
    int pid = _spawnvp(_P_NOWAIT, args[0], args);
IN JSX file :-
Validation takes place like this:-
function validate() {
try {
    if(app.activeDocument !=null) {   
        var doc = app.activeDocument;
        var fontArray = [];
//_April 26 2010_____________________________________________________________________________________ _____________
        var errors = [];
// Checks for invalid items in file
// ENH-88 validation for migrated AD
    var layerCount = doc.layers.length;
    for (i = 0; i<layerCount; i++ ) {
        //alert(doc.layers[i].name);
        if ( doc.layers[i].name == "Layer 1") {
            errors.push("- Incorrect template" );
    var iii;
    var placeItemFlag=true;
    var rasterItemFlag=true;
    var groupItemFlag=true;
    for (iii=0 ; iii<doc.pageItems.length ; iii++) {
            switch ( doc.pageItems[iii].typename ) {
                case "PlacedItem":
                    if ( ! doc.pageItems[iii].embedded ) {
                        errors.push(doc.name + " has linked file " + doc.pageItems[iii]);
                    if(doc.pageItems[iii].overprint == true) {
                        errors.push("- Over print found in the following object : " + doc.pageItems[iii].typename);
                break;
                case "RasterItem":
                if ( ! doc.pageItems[iii].embedded ) {
                        errors.push(doc.name + " has linked file " + doc.pageItems[iii]);
                    //INT-1161
                if(doc.pageItems[iii].overprint == true && rasterItemFlag) {
                        errors.push("- Over print found in the raster item");
                        rasterItemFlag=false;
                break;
                case "CompoundPathItem" :
                break;
                case "GraphItem" :
                break;
                case "GroupItem" :
                break;
                case "LegacyTextItem" :
                    errors.push("- Legacy text found ");
                break;
                case "MeshItem" :
                break;
                case "PathItem" :
                //INT-1161
                if(doc.pageItems[iii].overprintFill == true && placeItemFlag ) {
                        errors.push("- Over print found in the image");
                        placeItemFlag=false;
                break;
                case "PlacedItem" :
                break;
                case "PluginItem" :
                break;
                case "RasterItem" :
                    if(doc.pageItems[iii].overprint == true) {
                        errors.push("- Over print found in the following object : " + doc.pageItems[iii].typename);
                break;
                case "SymbolItem" :
                break;
                case "TextFrame" :
//Modified by Binu T V to catch the object undefined exception in "doc.pageItems[iii].textRange"______________________________________
               try   
                    if(doc.pageItems[iii].textRange.length > 0) {
                        var itemType = doc.pageItems[iii];
                        if ( doc.pageItems[iii].converted == false) {
                            errors.push("- Legacy text found ");   
                        else if(doc.pageItems[iii].textRange.overprintFill == true || doc.pageItems[iii].textRange.overprintStroke == true) {
                            errors.push("- Text over print found for - " + doc.pageItems[iii].contents);
                catch(e)
                        var itemType = doc.pageItems[iii];
                        if ( doc.pageItems[iii].converted == false) {
                            if(!String(errors).search("- Legacy text found ") == 0)
                                errors.push("- Legacy text found ");   
                        else if(doc.pageItems[iii].textRange.overprintFill == true || doc.pageItems[iii].textRange.overprintStroke == true) {
                            if(!String(errors).search("- Text over print found " ) == 0)   
                                errors.push("- Text over print found for - " + doc.pageItems[iii].contents);
                break;
// Checks for illegal fonts
    fontArray=readFontList();
        var noOfText = doc.textFrames.length;
        for ( i = 0; i < noOfText; i++ ) {
            var CS3Text = doc.textFrames[i];
            var parentLayer = CS3Text.layer.name;
            // ENH-88 Removed the condition which checks for work layer when checking fonts
            if ( CS3Text.textRange.length >0) {
            // Check if illegal font
                var fontFound = CS3Text.textRange.characterAttributes.textFont.name;
                if (fontExist(fontFound , fontArray) == false) {
                    errors.push("- Illegal font " + fontFound + "  " + CS3Text.contents);
        } and so on.......
After the validation, I save it like this :-
dest = new File(app.activeDocument.path + '/' + newName);
            // INT-922
            var initialModifiedDate= File(dest).modified;
            if(suffix == "pdf")
                //saveFileToPDF(dest);
                doc.saveAs(dest, options);
            }else
                //exportFileToAI (dest);
                doc.saveAs(dest, options);

Similar Messages

  • User exit in Delivery after the SAVE button is pressed.

    When the Delivery gets picked and Post Goods issued , the Delivery quantity for example instead of 48,000 LBS may be little less say 47,345 LB. We need to update this number in the order quantity which will originally have 48,000 LBS.
    I need to update this quantity in the sales order VA02 after the delivery is saved. Whats the user exit AFTER the save button is pressed?
    Thank you in advance

    Hi,
    Check this User Exits related to Delivery,
    Delivery related exits
    V50PSTAT - Delivery: Item Status Calculation
    V50Q0001 - Delivery Monitor: User Exits for Filling Display Fields
    V50R0001 - Collective processing for delivery creation
    V50R0002 - Collective processing for delivery creation
    V50R0004 - Calculation of Stock for POs for Shipping Due Date List
    V50S0001 - User Exits for Delivery Processing
    V53C0001 - Rough workload calculation in time per item
    V53C0002 - W&S: RWE enhancement - shipping material type/time slot
    V53W0001 - User exits for creating picking waves
    VMDE0001 - Shipping Interface: Error Handling - Inbound IDoc
    VMDE0002 - Shipping Interface: Message PICKSD (Picking, Outbound)
    VMDE0003 - Shipping Interface: Message SDPICK (Picking, Inbound)
    VMDE0004 - Shipping Interface: Message SDPACK (Packing, Inbound)
    V02V0001 - Sales area determination for stock transport order
    V02V0002 - User exit for storage location determination
    V02V0003 - User exit for gate + matl staging area determination (headr)
    V02V0004 - User Exit for Staging Area Determination (Item)MV50AFZ1 - User Exits for Delivery Processing
    MV50AFZ2 - User Exit for Batch Quantity Allocation
    MV50AFZ3 - LIPS-KOQUI (Picking is subject to confirmation) determination
    MV50AFZK - The user exits in this include can be used to fill the condition tables for material listing and
    material exclusion (KOMKG and KOMPG) and product selection (KOMKD and KOMPD) with own data.
    MV50AFZL - In delivery creation process for sales orders there is the possibility to restrict the delivery creation to some order items.
    If these order items are member of a delivery group, but not all items of
    this delivery group are includes in the restriction range of the order item nubers, you can specify in this routine what to do.
    MV50AFZP - This user exit can be used to modify change mode of pricing screens in delivery processing.
    MV50AFZZ - Users Exit for Batch Determination; LIPS-LGORT determination
    Thanks & regards,
    Dileep .C

  • User after the save of customer Master

    Hi,
    I am working on the SAP 4.6C.
    I am creating the customers in the XD01.
    I would like to trigger an exit after the save of the customer Doc to create hierarchy.
    This is required as the FM to create the hierarchy needs the customer number.
    Could any one pls let me know the exit to do this?
    Thanks.
    Murgh.

    Thanks for the mail.
    ZXF04U01 is the include where i am trying to create the hierarchy.This is the one which triggers after the save.
    I need to triger hierarchy FM after the commit work has happend.
    How can i call the FM which can triger after the commit work is done.
    Pls advise.

  • Upgrade the production order after the save.

    Dear Gurus,
    i need of modify the production order quickly after the save.
    Can you help me?
    I must run the Bacht input custom for upgrade the order.
    How i can run the Bach input quickly after the save order?
    There are the others method for my problem?
    Thanks a lot for your help.
    PP Team
    Daniele Pistilli

    Hi,
    Not sure what you're trying to update as you're post is not quite clear.
    Anyways you can use the user exit - ppco007 or badi - WORKORDER_UPDATE method AT_SAVE. These enhancements are called at the time of saving the production order, so you can do your custom programming in them, take the help of your abaper.
    Regards,
    Vivek

  • Home folder window resizes after shut down

    Since updating to Yosemite, I notice that my Home Folder (window) resizes it self upon restart (after a shut down) thereby allowing me to see only a few of the dozen or so folders I keep inside. This is different in my experience from all other previous versions of Mac OS, where the Home Folder always opened in the size I set for it.
    Does anyone know a fix for this?

    denlv,
    You could try trashing the hidden file ( .DS_Store ) inside the folder that stores some of its positioning and size settings.
    To show your hidden files.
    Launch ( Terminal ) > Paste in the following ( defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder ) > Press Return.
    Open the ( Offending Folder ) > Delete ( .DS_Store ) > Restart > Move folder how you want to to stay > Restart > Resize and try again to recreate > Did it stay?
    To reverse your hidden files back to hidden.
    Launch ( Terminal ) > Paste in the following ( defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder ) > Press Return.
    Supporting Articles
    http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/
    http://en.wikipedia.org/wiki/.DS_Store
    Hope that helps,
    Weston

  • Problem installing windows 7 after the establishment of windows 8м

    Hi, I had a problem. Recently, I broke Windows 8, I tried to restore it, but somehow I failed, now I tried to install Windows 7, while it highlights my error - "A media driver your computer needs is missing. This could be a DVD, USB or Hard disk driver. If you have a CD, DVD, or USB dlash drive with the driver on it, please insert it Now.
    Note:if the installation media for windows is in the DVD drive or on a USB drive, you can safely remove it for this step."
    That's the name of my laptop - HP Envy dv7-7388sr
    I Windows Installing from flash drive.
    Please help me find this driver and start using laptop.
    This question was solved.
    View Solution.

    Hi:
    See if this works...
    Download the drivers from this link below (first or second file listed -- 32 or 64 bit as applicable).
    https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&ProdId=2101&DwnldID=23060&keyword=Intel+Rapi...
    Copy the files onto a usb flash drive without any folders.
    With the flash drive and W7 installation media plugged into the machine, boot from the W7 installation media.
    After you select the install now option, select the Drive Options - Advanced menu, then select the Load Driver option.
    You should now see the storage driver files listed.
    If you check the box, it will only include the compatible driver.
    Follow the prompts and hopefully, W7 will install.

  • The firefox setup 3.6.3 will not start on windows xp after the extracting process

    What I Did first was I Downloaded mozilla firefox 3.6.3 from mozilla.com for windows and after I run It , the installation process asked me to run it or cancel it to which I ran it and after it extracted , it just wouldn't show up on the desktop but is visible in windows task manager [my computer is windows xp]and I am Logged on as the administrator as well.
    == every time I tried to install mozilla firefox ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)

    thanks chris for the reply back,i have solved the massive problem i have had with MF 3.6.3 it ws COMODO FREE FIREWALL i had a sneaking suspicion all a long it could have been that but was not sure?,my pc had slowed down since installing comodo i am pretty sure of that,there were lags and pauses ect ect on general usage of the pc even though cpu usage was ok?,so maybe if many pc users that have comodo firewall installed they might like to try a change to another firewall and see if it helps,i went back to OUTPOST FREE FIREWALL which i had for ages without ANY problems whatsoever.
    regards
    john
    mozilla firefox build 3.6.3

  • Unable to Open Public folders from Windows XP after the upgrade of CU4 to Cu7

    We still have few machines running windows Xp, who cannot access Public folders after the upgrade to the latest CU7. Is there any fix for it other than moving them to Windows 7?

    Hi DNair,
    Hope you are already upto date. But still just putting it through to cross check.
    Outlook Versions Supported by Exchange 2013
    The following Outlook client versions are fully supported by Exchange server 2013. Please bear in mind there’s a difference between what is supported and what might be compatible with Exchange 2013.All
    of the Outlook versions listed below have been thoroughly tested by the Exchange Product group:
    Outlook 2013
    Outlook 2010 SP1 with November 2012 Cumulative Update ( available from
    http://support.microsoft.com/kb/2687623 )
    Outlook 2007 SP3 with November 2012 Cumulative Update ( available from
    http://support.microsoft.com/kb/2687404 )
    Entourage 2008 for Mac, Web Services Edition
    Outlook for Mac 2011
    Outlook clients earlier than Outlook 2007 are not supported.
    Find and Manage
    Outlook Updates here.
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • ITunes won't load on Windows 7 after the last update

    iTunes won't load on my Windows 7 machine after the last update. There is no error, but the window opens and says "Checking iTunes library" for a while, and then pops up iTunes. When it comes up, I can see it but it won't load or let me interact with it. The window I can see is my podcast library and it suggests it's accessing the iTunes Store. Right clicking, alt-tabbing seem to have no effect, and I can only shut it down in Task Manager. I've tried uninstalling and reinstalling with no luck (...twice). Any other ideas?

    Hello Aristoph,
    After reviewing your post, I have located an article that can help in this situation. It contains a number of troubleshooting steps and helpful advice concerning iTunes for Windows issues. If you follow the directions in order it may help:
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/ht1923
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Window resizing after airplay use

    The annoying thing, is it possible to avoid the window resizing each time i have used airplay from desktop to ATV, so i dont have to scale back and reposition every open app everytime i need to switch back?

    -> Start Firefox in -> [[Safe Mode]] to check if your add-ons/extensions are causing the problems.
    * Also see this article -> [[Troubleshooting extensions and themes]]
    Check and tell if its working.
    For Crashing problem, see this article -> [[Firefox Crashes]]
    * IF it crashes again, submit your Crash IDs here as described in section '''"Get Help Fixing this Crash"''' of the above mentioned article.

  • Why do windows resize after connecting to video?

    When I plug my MacBook into a video display - my TV or an LCD projector - the windows of open programs resize, mainly get smaller (not full screen) and get stretch horizontally.  This makes it difficult to manage applications while on video, and makes them all look funny on the screen.  Is there a way to avoid this?  I don't see any point in why you would want it to do that.  It is just a big pain especially when making a public presentation.
    thanks for any help you can give.
    MacBook 2.1  Lion .1
    4mb RAM  120 gb disk

    Hi pandugadu,
    When you tried resetting your iPod (per the instructions in the Apple article), did the iPod sucessfully restart and display the Apple logo on its screen?
    If so, then let's try forcing your iPod into disk mode. For instructions, see:
    Putting iPod into disk mode
    With the iPod hopefully in disk mode, try connecting it to your computer, and see if it's recognized.
    If the iPod simply isn't responding and won't get off the "Do Not Disconnect" screen (even when its not connected to your computer), then you might want to try letting your iPod's battery drain down.
    Then, when it's finally dead on battery power, let it recharge through a power source, preferrably a wall charger.
    If your iPod simply isn't being recognized by iTunes (but it's not having a problem of freezing up, separate from iTunes), then check out the suggestions from these Knowledge Base articles, and see if they help:
    iPod missing in "My Computer" or in iTunes for Windows
    iPod is recognized by Windows but not iTunes
    iTunes 7 doesn't recognize iPod
    Fast user switching on a Windows computer is not supported for iPods
    iPod is not recognized properly by computer when USB drivers are not installed properly or are out of date
    Any success after trying that?
    -Kylene

  • Flash plugin window resize problem

    When i try to resize non-maximized window with this page, firefox not let me do this. I tried on other browsers works fine, but firefox just cancel resize operation and change it's size only on 1-3 pixels.
    [http://armsenergy.com/as3/forFirefox/index.php back up'd example]

    Try to "disable the hardware acceleration" in the Flash Player.
    *http://helpx.adobe.com/flash-player/kb/video-playback-issues.html
    See also:
    *https://support.mozilla.org/kb/keep-flash-up-to-date-and-troubleshoot-problems
    Flash "Display settings" window:
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html
    You can check for problems caused by a recent Flash 11.3 update and possibly downgrade to Flash 11.2 or 10.3.
    *https://support.mozilla.org/kb/flash-113-doesnt-load-video-firefox
    *https://support.mozilla.org/kb/flash-113-crashes

  • How do I get my old mozilla window back after the upgrade automatically changed it without asking me ?

    What I would like is the screen/startup window I had in the version previous to this new upgraded window. The window that comes up when mozilla is started. I didn't want to upgrade, didn't get asked by mozilla and I was perfectly happy with mozilla having that nice orange tab where I coul find everything I needed, Also like the bookmarks organizer better with the old version.
    Thanks hope I can get it back
    SpiritHawk

    Hello See this help article [[How to make the new Firefox look like the old Firefox]]
    See also:
    * https://support.mozilla.org/kb/common-questions-after-updating-to-new-firefox
    * https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox
    * https://support.mozilla.org/kb/how-to-make-new-firefox-look-like-old-firefox
    * https://support.mozilla.org/kb/what-happened-to-the-add-on-bar
    * Tabs On Bottom: https://addons.mozilla.org/firefox/addon/tabs-on-bottom/
    * The Addon Bar (restored): https://addons.mozilla.org/firefox/addon/the-addon-bar/

  • Why does my window resize after Firefox has loaded from being opened

    Firefox opens to the full screen at first, but as the tabs finish loading the window collapses to a half screen. I have tried resetting the advanced JavaScript settings to no avail.

    Does that also happen if you start Firefox with an blank page?
    Tools > Options > General > Startup: "When Firefox Starts": "Show a blank page"
    See also:
    *http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features
    *http://kb.mozillazine.org/JavaScript#Advanced_JavaScript_settings
    *http://kb.mozillazine.org/Preferences_not_saved
    *http://kb.mozillazine.org/Corrupt_localstore.rdf
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    # Shockwave Flash 10.0 r32
    # Java Plug-in 1.6.0_11 for Netscape Navigator (DLL Helper)
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • How do you redirect the user to a custom page after the "Save" button is clicked?

    In SharePoint 2010, I could add the following code to a save button to redirect the user to a custom page.
    <input type="button" value="Submit" class="btnStyle" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={/SitePages/Thankyou.aspx}')}" />
    However, how do you do this for a save button in SharePoint Online? The code of a save button in SharePoint Online looks like
    <input type="button" value="Save" name="ctl00$ctl33$g_175de2e0_43c1_4005_bac5_0ab02439686f$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem" onclick="if (!PreSaveItem()) return false;if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ1')) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ctl33$g_175de2e0_43c1_4005_bac5_0ab02439686f$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true;javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={/SitePages/Thankyou.aspx}')}))" id="ctl00_ctl33_g_175de2e0_43c1_4005_bac5_0ab02439686f_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_diidIOSaveItem" accesskey="O" class="ms-ButtonHeightWidth" target="_self">

    Not exactly what you are asking for, but if you are creating the link then you could add "?Source=" to the URL.
    http://yourServer/sites/yourSite/Lists/TestList/NewForm.aspx?Source=/SitePages/Thankyou.aspx
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

Maybe you are looking for