Script change from CS6 to CC 2017

Post Reply
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Script change from CS6 to CC 2017

Post 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");  
    }  
loicaigon
Advanced member
Posts: 362
Joined: Wed Jul 10, 2013 10:22 am

Re: Script change from CS6 to CC 2017

Post 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.
loicaigon
Advanced member
Posts: 362
Joined: Wed Jul 10, 2013 10:22 am

Re: Script change from CS6 to CC 2017

Post 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.
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Script change from CS6 to CC 2017

Post 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).
User avatar
TheCaptain
Member
Posts: 86
Joined: Mon Jan 18, 2016 4:22 pm
Location: London

Re: Script change from CS6 to CC 2017

Post by TheCaptain »

PM Sent.
User avatar
TheCaptain
Member
Posts: 86
Joined: Mon Jan 18, 2016 4:22 pm
Location: London

Re: Script change from CS6 to CC 2017

Post 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
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Script change from CS6 to CC 2017

Post by Terkelsen »

I'll try this later today and let you know the result.
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Script change from CS6 to CC 2017

Post 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 :-)
User avatar
TheCaptain
Member
Posts: 86
Joined: Mon Jan 18, 2016 4:22 pm
Location: London

Re: Script change from CS6 to CC 2017

Post 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:
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Script change from CS6 to CC 2017

Post by Terkelsen »

I do have a cat acting the same way :roll: :lol:
Post Reply