Page 1 of 1

Script change from CS6 to CC 2017

Posted: Mon Jul 10, 2017 10:41 am
by Terkelsen
I have been using the following java script with the Adobe Illustrator configurator i Switch for a long time. It simply crops to the art box and add a margin of 3 pixels. Up until now it has been running in Illustrator CS6. After upgrading to CC 2017 Switch returns an error that says: "Dynamic property 'jobIdentifier' has invalid value ''. I'm not a scripting expert and is wondering what has changed since this script that works fine in CS6 doesn't work in CC 2017?

Code: Select all

if (app.documents.length > 0)  
    {  
        //alert("more than 0");  
          var idoc = app.activeDocument;  
          var pageItemsCount = idoc.pageItems.length;  
        if (pageItemsCount>=1)  
            {     
                      
                    var margins = 3;  
                    if (margins>=0)  
                         {  
                                
                              var activeABindex = idoc.artboards.getActiveArtboardIndex();  
                              var newAB = idoc.artboards[activeABindex];  
  
                              var iartBounds = idoc.visibleBounds;  
                                
                              var ableft = iartBounds[0]-margins;  
                              var abtop = iartBounds[1]+margins;  
                              var abright = iartBounds[2]+margins;  
                              var abbottom = iartBounds[3]-margins;  
                                
                              newAB.artboardRect = [ableft, abtop, abright, abbottom];  
                                
                              var myZoom = idoc.activeView.zoom;  
                              idoc.activeView.zoom = myZoom+.01;  
                              idoc.activeView.zoom = myZoom;  
  
                         }  
                    else  
                         {  
                              alert("nos vamos");  
                         }  
             }  
         else  
            {  
                alert("there is no art in the active document");  
             }  
     }  
 else   
    {  
        alert ("there are no open documents");  
    }  

Re: Script change from CS6 to CC 2017

Posted: Mon Jul 10, 2017 12:09 pm
by loicaigon
A quick overview doesn't reveal any major flaw :\
Besides I did here and everything went well. It looks like more a Switch issue.

Re: Script change from CS6 to CC 2017

Posted: Mon Jul 10, 2017 12:10 pm
by loicaigon
A quick overview doesn't reveal any major flaw :\
Besides I did here and everything went well. It looks like more a Switch issue.

Re: Script change from CS6 to CC 2017

Posted: Mon Jul 10, 2017 1:35 pm
by Terkelsen
Well, yes. The script works fine if you run it manually in Illustrator CC 2017. It also works in Switch using the configurator for CS 6 but not using the configurator version 7 (for Illustrator CC 2014, 2015 and 2017).

Re: Script change from CS6 to CC 2017

Posted: Mon Jul 10, 2017 3:15 pm
by TheCaptain
PM Sent.

Re: Script change from CS6 to CC 2017

Posted: Mon Jul 10, 2017 3:54 pm
by TheCaptain
Okay, I've tried your files in our Switch and it runs through okay, without issues.

That's CC2017 and Version 7 (same as your original post I think)

Have you tried opening the Enfocus Pack Manager separately with Switch shut down? Deleting the Illustrator configurator then reinstalling and updating as necessary?

When I've had this issue before, a combination of removing and install usually clears things up.

ETA /Applications/Enfocus/Enfocus Switch 17/PackManager.app

Re: Script change from CS6 to CC 2017

Posted: Tue Jul 11, 2017 8:51 am
by Terkelsen
I'll try this later today and let you know the result.

Re: Script change from CS6 to CC 2017

Posted: Tue Jul 11, 2017 9:30 am
by Terkelsen
Problem solved! Even though I had already deactivated and reactivated the Illustrator configurator from within Switch without any effect the "trick" of closing down Switch and manually starting PackManager separately seems to work different. After doing this the script now works with CC 2017.

Thank you TheCaptain :-)

Re: Script change from CS6 to CC 2017

Posted: Tue Jul 11, 2017 10:42 am
by TheCaptain
Good, I'm glad you got sorted :)

It's a weird glitchy sort of thing with Switch in that you can install new components, but it won't recognise them until you force it to. A bit like how my dog can hear the sound of food hitting the floor from a hundred yards, but needs me to point to it for her to actually locate the snack! :lol:

Re: Script change from CS6 to CC 2017

Posted: Wed Jul 12, 2017 11:44 am
by Terkelsen
I do have a cat acting the same way :roll: :lol: