Skip navigation
Currently Being Moderated

Unable to Place Image in InDesign MAC using Extension Builder

May 8, 2012 5:58 AM

Hello,

 

I am using Extension builder along with InDesign CS5.5.

I need to place a file in InDesign rectangle box.

 

Following is the function:

public function placeImages(getFileObj:File):void{

                var parentDir:File =  getFileObj.parent;

                var FileToPlace:File = getFileObj.resolvePath(getFileObj.name);

                if(mx.core.Application.application.hostName == "com.adobe.indesign"){               

                    app.activeDocument.frameFittingOptions.autoFit = false;

                    app.activeDocument.frameFittingOptions.fittingOnEmptyFrame = EmptyFrameFittingOptions.FILL_PROPORTIONALLY;

                    app.activeDocument.frameFittingOptions.fittingAlignment = AnchorPoint.CENTER_ANCHOR;

                    var Indesignbox:com.adobe.indesign.Rectangle= app.activeDocument.spreads.firstItem().pages.firstItem().rectangles.a dd();

                    Indesignbox.geometricBounds = app.activeDocument.spreads.firstItem().pages.firstItem().bounds;

                    try{

                            Indesignbox.place(FileToPlace); // Auto scales…

                     }catch(e:Error)

                    {

                        trace(e);

                    }

}

 

This works perfectly on Windows. But I run the extension on MAC, somehow "/Volumes" is getting appended to the File object. File object in this case is "FileToPlace". Nornally a path would look like this:

“/Users/mini3/Documents/flower”. (This is just an example)

But, if I see in the trace, I get the following error:

Cannot find the folder “/Volumes/Users/mini3/Documents/flower”

 

As "/Volumes" is getting appended, InDesign is unable to find the path. Where from this is getting appended?

 

Has anyone used image place functionality on Mac in InDesign using Extension Builder.

Any help is appreciated, as I am really running short of time

 

Thanks...

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points