[JS] Exporting InDesign group as eps

Although all types of page items have an exportFile method in the object model, it does not seem to be possible to export a group of page items on a given page without exporting the entire
parent page using the exportFile method. Maybe this is a matter of implementation lagging behind documentation? In any case, I have used workarounds such as the following, but is there is a less clunky way to accomplish this task?
//Initial selection is either a group of page items or a single page item.
var d = app.documents[0];
var hUnits = d.viewPreferences.horizontalMeasurementUnits;
var vUnits = d.viewPreferences.verticalMeasurementUnits;
aGroup = app.selection[0];
path = app.documents[0].fullName.absoluteURI;
path = path.substring( 0, path.lastIndexOf('/') );
bnds = aGroup.geometricBounds;
var nd = app.documents.add(false);
with ( nd.masterSpreads[0].pages[0].marginPreferences ) {
  top = bottom = left = right = 0;
with ( nd.viewPreferences ) {
  horizontalMeasurementUnits = hUnits;
  verticalMeasurementUnits = vUnits;
with ( nd.documentPreferences ) {
  pageHeight = bnds[2] - bnds[0];
  pageWidth = bnds[3] - bnds[1];
var copiedGroup = aGroup.duplicate( nd.layers[0] );
copiedGroup.move( [0,0] );
copiedGroup.exportFile( ExportFormat.EPS_TYPE, File( path + '/' + 'TEST.eps' ), false );
nd.close(SaveOptions.NO);

Hello Uwe,
Thanks for the advice! I took your suggestion, and I find it worked nicely, after I adjusted pasteboardMargin preferences in the new document, but it does fail when there are multiple eps images already placed on the target page for reasons that are not clear to me. Below are the two different methods I came up with, the first copies the targeted group to a new doc, and the second uses your double eps export method. The problem I describe occurs even when I comment out the lines that remove the temporary eps file and close the temporary InDesign doc after exporting the final eps, which I thought might be causing the problem. Maybe there's not a perfect workaround, but I'd be pleased to be proven wrong in that regard!
Copy group selected for eps export to new document method:
var d, hUnits, vUnits, aGroup, path, bnds, nd, copiedGroup, fileName, docPreset;
if ( app.documents.count() != 1 || app.documents[0].saved != true || app.documents[0].selection.length != 1 ) { alert("A single, saved document must be open with a single item selected!\r"); exit(); }
aGroup = app.selection[0];
d = app.documents[0];
hUnits = d.viewPreferences.horizontalMeasurementUnits;
vUnits = d.viewPreferences.verticalMeasurementUnits;
path = app.documents[0].fullName.absoluteURI;
path = path.substring( 0, path.lastIndexOf('/') );
bnds = aGroup.visibleBounds;
fileName = prompt( "Enter a file name with a '.eps' extension for the eps file to be created from the  current selection:", ".eps" );
if ( fileName == null  ) exit();
if ( fileName.toLowerCase().search(/\.eps$/) < 1 ) {
  alert( "Invalid file name provided. Script will terminate!" ); exit();
docPreset = app.documentPresets.add({top:0, bottom:0, left:0, right:0});
app.scriptPreferences.enableRedraw = false;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
nd = app.documents.add(true, docPreset );
with ( nd.viewPreferences ) {
  horizontalMeasurementUnits = hUnits;
  verticalMeasurementUnits = vUnits;
with ( nd.documentPreferences ) {
  pageHeight = bnds[2] - bnds[0];
  pageWidth = bnds[3] - bnds[1];
copiedGroup = aGroup.duplicate( nd.layers[0] );
copiedGroup.move( [0,0] );
copiedGroup.exportFile( ExportFormat.EPS_TYPE, File( path + '/' + fileName ), false );
nd.close(SaveOptions.NO);
docPreset.remove();
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
app.scriptPreferences.enableRedraw = true;
Double eps export method:
var d, pg, hUnits, vUnits, aGroup, path, bnds, pgbnds, nd, fileName, tempFileName, docPreset;
if ( app.documents.count() < 1 || app.documents[0].saved != true || app.documents[0].selection.length != 1 ) { alert("A saved document must be open with a single group or a single page item selected!\r"); exit(); }
aGroup = app.selection[0];
d = app.documents[0];
pg = aGroup.parentPage;
pgbnds = pg.bounds;
hUnits = d.viewPreferences.horizontalMeasurementUnits;
vUnits = d.viewPreferences.verticalMeasurementUnits;
path = app.documents[0].fullName.absoluteURI;
path = path.substring( 0, path.lastIndexOf('/') );
bnds = aGroup.visibleBounds;
fileName = prompt( "Enter a file name with a '.eps' extension for the eps file to be created from the  current selection:", ".eps" );
if ( fileName == null  ) exit();
if ( fileName.toLowerCase().search(/\.eps$/) < 1 ) {
  alert( "Invalid file name provided. Script will terminate!" ); exit();
tempFileName = Math.random().toString() + '.eps';
app.epsExportPreferences.pageRange = pg.name;
d.exportFile( ExportFormat.EPS_TYPE, File( path + '/' + tempFileName ), false );
app.epsExportPreferences.pageRange = PageRange.ALL_PAGES;
docPreset = app.documentPresets.add({top:0, bottom:0, left:0, right:0});
app.scriptPreferences.enableRedraw = false;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
nd = app.documents.add(true, docPreset );
nd.pasteboardPreferences.pasteboardMargins = [ (pgbnds[3] - pgbnds[1])*2, (pgbnds[3] - pgbnds[1])*2 ];
with ( nd.viewPreferences ) {
  horizontalMeasurementUnits = hUnits;
  verticalMeasurementUnits = vUnits;
with ( nd.documentPreferences ) {
  pageHeight = bnds[2] - bnds[0];
  pageWidth = bnds[3] - bnds[1];
nd.pages[0].place( File(  path + '/' + tempFileName ), [ pgbnds[1] - bnds[1], pgbnds[0] - bnds[0] ], undefined, false, false );
nd.exportFile( ExportFormat.EPS_TYPE, File( path + '/' + fileName ), false );
nd.close(SaveOptions.NO);
File(  path + '/' + tempFileName ).remove();
docPreset.remove();
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
app.scriptPreferences.enableRedraw = true;

Similar Messages

  • Export Selected Text as EPS

    Hi All,
    I want export my selection (text) as EPS using InDesign CS4.
    Please suggest how it possible to export selection text as eps.
    Thanks,
    Shonky

    Do you literally mean you have a textbox with lots of text, you select one single word (for example), and then want to export just this one word?
    I can't think of any possible way. What if you select a sentence that runs from the right side of your text frame and wraps to the next line on the left side of that same frame?
    If you want to have an EPS containing some text, you might want to copy the text, paste it into a new document, then export that.

  • Export indesign pages as jpegs?

    I can't seem to export my indesign files as jpegs in CC. I am able to export pdf's and eps files, but not jpegs or png files. There is no error message or warning, the dialogue box comes up as normal, but the files never export. Has anyone else had this problem? I have never had an issue in earlier versions of Indesign. Any help is much appreciated!

    It's working for me, and I don't remember this being reported here before.
    I'd suggest starting by restoring your InDesign preferences:
    FAQ: How do I reset or "trash" preferences?

  • How can I export a group email address to a .csv file. I can export the whole address book but it looses the group listings.

    I have an address book in Thunderbird and want to export one group listing to a .csv file. I couldn't find a way of exporting one group so exported the whole address book then opened the .csv file and was going to remove the all addresses except the group but the group name was not in the file.
    Is it possible to export the group listing.
    Thanks
    Ron

    Open Address Book, select the mailing list in the left pane, then Tools/Export, select csv (comma separated) format, name the file, click Save.

  • [Forum FAQ] How do I export each group data to separated Excel files in Reporting Services?

    Introduction
    There is a scenario that a report grouped by one field for some reasons, then the users want to export each group data to separated Excel files. By default, we can directly export only one file at a time on report server. Is there a way that we can split
    the report based on the group, then export each report to Excel file?
    Solution
    To achieve this requirement, we can add a parameter with the group values to filter the report based on the group, then create a data-driven subscription for the report which get File name and parameter from the group values.
    In the report, create a parameter named Name which use the Name field as Available Values (supposing the group grouped on Name field).
    Add a filter as below in the corresponding tablix:
    Expression: [Name]
    Operator: =
    Value: [@Name]
    Deploy the report. Then create a data-driven subscription with Windows File Share delivery extension for the report in Report Manager.
    During the data-driven subscription, in the step 3, specify a query that returns the Name field with the values as the group in the report.
    In the step 4 (Specify delivery extension settings for Report Server FileShare), below “File name”option, select “Get the value from the database”, then select Name field.
    Below ‘Render Format’ option, select Excel as the static value.
    In the step 5, we can configure parameter Name “Get the value from the database”, then select Name field. 
    Then specify the subscription execute only one time.
    References:
    Create a Data-Driven Subscription
    Windows File Share Delivery in Reporting Services
    Applies to
    Reporting Services 2005
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • Is it possible to export a Group from Contacts to a spreadsheet? I have Version 8.0 (1371.2) on my Mac

    How can I export a Group in Contacts to an Excel spreadsheet ? I've tried to follow the instructions but am going in circles:  I opened the Group, then 'selected" all contacts in the Group, then chose File>Export>Export vCard. Saved it to Desktop, but when I open the file from desktop, it appears that I'm Importing them to Contacts.... I just want a spreadsheet that I can import into Constant Contact.

    It's not possible.
    Apple - Feedback

  • I want to export a group of photos from iphoto.

    I want to export a group of photos from iphoto. I want them to stay in the same order that I put them in. So far when I export, the photos sort according to date or name. I want them to stay in manual sort the way I set them up in the album.
    I also want to import them in that order to another program. I am going to try to import them into Final Cut Pro 7. I still want them in the sorted order.
    Can this be done?
    jibetack

    So, in other words, it can't be done. Once the photos are exported they lose the order I had them in in iphoto.
    Not at all
    typically the easiest way it to export from iPhoto using the sequential file name option and then view in alpha order
    and
    What is a better software to organize and sift through photos than iphoto?
    None as far as I am concerned - that is strictly a personal decision that you have to make for yourself - Only you know what features you want - no one else does
    LN

  • Pb XML with export report group

    Hello,I am trying to export a group of reports under ( Analyzer 6.1.1 DB2 W2K ) to import it onto another server ( Analyzer 6.2 oracle 9.2 W2K ).The export and import work fine and the documents can be found in Analyzer 6.2 - however, when I try to export from6.2, I get an XML error [email protected]

    Do you have a report open when you export/import ?I got the same error because my 'Main' report was open when the commands was executed.

  • Exporting address groups in Entourage

    Hi there
    I'm wanting to either export a group of email addresses in Entourage, so I can load it up to my webmail service, or copy in over to a different email identity in entourage - I can't say a way of doing either of these - exporting the address book does not create email groups.
    Can anyone find me a solution please?
    Thanks very much
    Viv

    You might try the following item:
    http://scriptbuilders.net/files/exportimportentourage1.3.9.html
    Good luck.
    Bronson

  • I have trouble exporting indesign file as pdf.

    I have trouble exporting indesign file as pdf. I need help please.

    Hi,
    Please start by telling us what happens when you try, and also how you are exporting the file.
    Regards,
    Malcolm

  • Export target group by using mail form?

    Hi Gurus,
    we have a requirements to export the target group to a file but with the attributes we defined in Mailform. If I chose the export to a file then I need to enhance a BADI to define all these attributes again.
    Is it possible to export target group to a file by leverage the mail forms?
    We are working on CRM7.0
    Thanks,
    Wu

    Hi Hongfa,
    Export target group to file
    You use this function to export the business partner data for target group members to a file, so that you can process this data further at a later date, or simply for storage purposes.
    You can choose which business partner fields the export file will contain. You use the BAdI CRM_MKTTG_SEG_MEM_EX to define the fields you require.
    The name of the file you create is freely definable. The file name you specify is saved in the logical file path MARKETING_FILES, which you define in Customizing (see Prerequisites). The data is written to two files: a data file that contains the actual data, and a meta file that contains the description of the data (for example, field types and field descriptions). In the standard system, MARKETING_FILES refers to the DIR_GLOBAL directory (transaction AL11). There is no restriction on the number of business partners.
    Thanks & Regards,
    Srini

  • Can No Export InDesign Snippets

    I am using InDesign CS6 8.0.2 (updated today, 4/28/2014) on Mac OSX 10.9.2, 2.6 GHz Intel Core i7, 8 GB 1600 MHz DDR3
    I am attempting to export snippets to my desktop via File-Export-Format InDesign Snippet.
    Everything appears to operate correctly, but I can not find the idms file on my desktop.
    Is there a setting I need to change?
    Thanks for any time and help offered.

    @TheOaksMan – there are two options to export IDMS files (snippet file format) out of InDesign.
    Select one or some objects on the page and:
    1. Export to IDMS with the menu command File / Export… / InDesign-Snippet
    or:
    2. dragging the selected objects out of the page to the file system (Finder)
    No need to drag it to the Desktop folder, every folder you have write permission will fit.
    Does option 2 work for you?
    Uwe

  • Can I export InDesign files to Adobe Illustrator for editing?

    Can I export InDesign files to Adobe Illustrator for editing? I am not familiar with InDesign, but I am familiar with Illustrator.  I have CS6.  Hope someone can help.  I have a large Orientation Booklet that needs updating and do not have the time to get tutored in InDesign.

    No.
    The closest you’ll get is a PDF and Illustrator is not a general purpose PDF editor.
    Good luck.

  • Export AD group members to csv powershell with full details

    Hi,
    please help me...
    How to Export AD group members to csv powershell with full details
    fasil cv

    Yep, that's true. Even if we try:
    $GroupName = "group1"
    Get-ADGroupMember -Identity $GroupName | where { $_.objectClass -eq "user" } | % {
    Get-ADUser -Identity $_.distinguishedName -Properties * | select * |
    Export-Csv -Path "$GroupName.csv" -NoTypeInformation -Append -Force
    By scoping the Get-ADGroupMember to user objects, we may still have mismatched columns since some users may have properties that others do not; like 'isCriticalSystemObject'
    I suppose one solution is to enumerate the properties before the Export, and add the consistent ones to a custom PSObject, and export that to CSV. It would help if the task requirement specifies what user properties are needed instead of the blanket "full
    details", or if we export to XML instead of CSV.
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    Filtering the object type to just user objects is already implicit in Get-ADUser. If you really want information on all the members you'll need to run Get-ADUser on the user objects, and Get-ADGroup on the group objects.
    Edit: There might also be computer account objects in there, too.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • I am trying to export indesign doc containing MP4 to interactive PDF but videos don't appear on exported PDF?

    I am trying to export indesign doc containing MP4 to interactive PDF but videos don't appear on exported PDF?
    This is the Id screen

    You haven't told us what PDF reader you're you're using to watch the video in the interactive PDF. You still haven't told us whether you exported File > Export > PDF (Interactive) or PDF (Print)? Please answer the questions so we can try to help you.

Maybe you are looking for

  • XML into one string element

    Hello,         In Graphical mapping, Could anyone pls tell me in detail about how to achieve One whole xml into one string element. This XML file i want to send to DATABASE.

  • Transfer from itouch to computer

    how do i copy all my music from my old itouch to the computer/itunes so i can put it on my new itouch

  • Conversion from Blended codepage 6200 to MDMP in 4.6c

    Hi Experts,    If the existing system is on 4.6c, what are the complications as well as the effort required to convert the ambiguous code page to MDMP?    Thank you. regards, David

  • *urgent* importing third party API

    hi, To import the third party *.jar we bought, I click on Project->Project Properties->library->add->new Then I give the APi a name in a the box Then I click on ... Classpath ->add ZIP/JAR and browse to choose the Jar file to be added to our project.

  • Send mail trough a FORM in IAS

    Hi all, I have a form that sends a mail and in the mail there will be some global variables. I can get it to work when testing with developer, but in production under AS Portal it doesn´t work. Can someone provide help for this? Best, João Rico