Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:10:05+00:00 2026-06-07T21:10:05+00:00

activeDocument.fitArtboardToSelectedArt() When calling this command, AI crashes on AI 5.1/6 32bit and 64bit versions.

  • 0
activeDocument.fitArtboardToSelectedArt()

When calling this command, AI crashes on AI 5.1/6 32bit and 64bit versions. I can use the command from the menu. Has anyone encountered this? does anyone know of a work around?

The full code.

    function exportFileToJPEG (dest) {
    if ( app.documents.length > 0 ) {

        activeDocument.selectObjectsOnActiveArtboard()
        activeDocument.fitArtboardToSelectedArt()//crashes here
        activeDocument.rearrangeArtboards()

        var exportOptions = new ExportOptionsJPEG();
        var type = ExportType.JPEG;
        var fileSpec = new File(dest);
        exportOptions.antiAliasing = true;
        exportOptions.qualitySetting = 70;
        app.activeDocument.exportFile( fileSpec, type, exportOptions );
    }
}
var file_name = 'some eps file.eps'
var eps_file = File(file_name)


var fileRef = eps_file;



if (fileRef != null) {
    var optRef = new OpenOptions();
    optRef.updateLegacyText = true;
    var docRef = open(fileRef, DocumentColorSpace.RGB, optRef);
}

exportFileToJPEG ("output_file.jpg")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:10:07+00:00Added an answer on June 7, 2026 at 9:10 pm

    I can reproduce the bug with AI CS5.

    It seems that fitArtboardToSelectedArt() takes the index of an artboard as an optional parameter. When the parameter is set, Illustrator doesn’t crash. (probably a bug in the code handling the situation of no parameter passed)

    As a workaround you could use:

    activeDocument.fitArtboardToSelectedArt(
                   activeDocument.artboards.getActiveArtboardIndex()
                                           );
    

    to pass the index of the active artboard with to the function. Hope this works for you too.

    Also it’s good practice to never omit the semicolon at the end of a statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
I have this in my Word Macro ActiveDocument.SaveAs FileName:=D:\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRock\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\GrooveAndRockAndRoll\\Ug F Blug and Bug f
I thought i'd use a macro to speed up writing <xsl:choose> blocks. DTE.ActiveDocument.Selection.Text =
Here is my attempt: function makeAllTextBlack() { var document = app.activeDocument, textFrames = document.textFrames,
In this tutorial (and many others), there's an integer in the CustomXMLParts object collection
Im writing a visual studio (2010) extension with a right click menu whilst in
With ActiveDocument.MailMerge .MainDocumentType = wdCatalog .OpenDataSource Name:=excelfile, _ Connection:=Entire spreadsheet, SubType:=8, ReadOnly:=True ''# Range
The following code only updates the fields outside the page headers. ActiveDocument.Fields.Update I also
Is that possible to get the words count from the MS Word without the
I am currently copying a lot of diagrams from excel to word via macro.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.