[JS CS3, win] Saving InDesign using app.activeDocument.save

Hello.

I have problems saving a document in InDesign using Javascript.

My goal is to have a box in the document where I type the name of the file and the path where I want to save the InDesign file (eventually it will be generated from a datamerge).

Then, I want to run a script that will read the contents of the box and then save the document to the file name or location.

At the moment I have:

SaveText.jsx
A JavaScript InDesign CS3
//
Saves the document in the provided path

get the content of the FileNameBox box on the document
var varFileName = app.activeDocument.textFrames.item("FileNameBox").contents;
Save now
app.activeDocument.save ("/" + varFileName + ".indd");

Alert (app.activeDocument.filePath);

When I run the script (with 'Hello' in the FileNameBox) file changes its name on the top bar of InDesign to "Hello.indd", but (when I run the commented warning at the end) the file is not actually save anywhere.

If I close InDesign, then open it the file is listed under 'Open recent' on the menu, but clicking on it does nothing - even when the file does not exist.

Does anyone have ideas to help me to tear my hair out?

Where is my save file? (Or, if not, how can I do save!).

Thanks in advance for any help you can offer.

var myFolder = new Folder ("~/Desktop/Test");
If (! myFolder.exist) myFolder.create ();
var varFileName = app.activeDocument.textFrames.item("FileNameBox").contents;
app.activeDocument.save (myFolder.fsName + "\" + varFileName + ".indd");
Alert (App.activeDocument.FilePath);

Tags: InDesign

Similar Questions

  • Or is the error: app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

    Hello

    I have a script that works on Mac, I pass it on PC, and here he made a mistake with this message "a general photoshop error occurred. "This is may not be available in this version of photoshop.

    This is my function:

    Function to save files

    function SaveFile() {}

    var app.activeDocument.name = docRef;

    saveFile = new File(destinationFolder+"//"+docRef);

    Alert (SaveFile);

    saveOptions = new JPEGSaveOptions();

    saveOptions.embedColorProfile = true;

    saveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;

    saveOptions.matte = MatteType.NONE;

    saveOptions.quality = 10;

    app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

    app.activeDocument.close (SaveOptions.DONOTSAVECHANGES)

    }

    Can someone help me?

    Thank you

    "saveFile" is defined on line 14

  • [ID CS3 (Win)] - where InDesign stores my name of PDF file?

    Have you experience this before? You have a document (let's call it "MyDoc.indd") and you want to use as a base for a new document ("NewDoc.indd").

    If you open MyDoc, save as "NewDoc. You are now working on NewDoc.

    Some time later, you go to NewDoc export to PDF and remembers MyDoc and recommends as file name for the PDF file. If you change the file name for your PDF file, and then save your INDD file, it will now remember the new name as your default PDF name.

    But what happens if you want to change this beforehand, for example: you are not ready to export the file, but you want to make sure that when you (or someone else does) that they use the correct file name?

    -Tom

    PS: I noticed that this behavior is different on a Mac and a PC.

    If you use the default name for your PDF, which is the same as the .indd file name no export name is stored in the data file. However, if you export and change the name, THEN SAVE THE FILE, exported new name will be written in the data file and will not survive another record just one save slot, and the only way to remove it is to export to .idml/.inx.

  • "activeDocument.saveAs" does not work! -> Error 8800 | PS CS5 | Mac OSX 10.5.8

    Error 8800: General Photoshop error occurred. Maybe this feature is not available in this version of Photoshop.

    I even tried to copy the Script in the script Guide.

    jpgFile = new File( "/Temp001.jpeg" ) 
    jpgSaveOptions = new JPEGSaveOptions() 
    jpgSaveOptions.embedColorProfile = true 
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE 
    jpgSaveOptions.matte = MatteType.NONE 
    jpgSaveOptions.quality = 1 
    app.activeDocument.saveAs(jpgFile, jpgSaveOptions, true, 
    Extension.LOWERCASE)
    

    The rest of my Scripts work :-/

    Any Tipps?

    var path = app.activeDocument.path

    jpgFile = new File( path + "/Temp001.jpeg" )
    jpgSaveOptions = new JPEGSaveOptions()
    jpgSaveOptions.embedColorProfile = true
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE
    jpgSaveOptions.matte = MatteType.NONE
    jpgSaveOptions.quality = 1
    app.activeDocument.saveAs(jpgFile, jpgSaveOptions, true,
    Extension.LOWERCASE)

    perhaps this works

  • Add the new page number with gaps in indesign extension app

    Hi all

    I develop an application for extension adobe indesign with adobe flex 3.4 sdk.

    the application object is to publish the document to a remote server.

    I did well all options.

    now I am facing problems to Polish.

    the problem is,

    (1) adding new page

    Let's say that a particular indesign document (portrait) contains 6 pages.

    Page 1, 2 are spread

    Page 3

    Page 4

    Page 5, 6 are spread

    Now, I will add a new page through the indesign extension.

    When I try to add a new page. It will add to the last page of the spread. (Page 5, 6)

    Finally, he became Page 5, 6 and 7 in propagation.

    What I want is.

    After you have added the new page, the document must have the following structure.

    Page 1, 2 are spread

    Page 3

    Page 4

    Page 5, 6 are spread

    Page 7

    Is my code to add the new page.

    document: var Document = app.activeDocument;

    document.pages.Add ();

    Please suggest me how to add a new page (without extension)

    Thank you

    Malaris

    Try the code below

    document: var Document = app.activeDocument;

    document.spreads.Add ();

    But make sure you use this code on a document that may be the structure of the page that had mentioned you, that is to say it must be created by unchecking the options 'facing Pages' in the dialog box new document. Otherwise, it will add two pages of the document.

    This should solve your problem.

    Manan Joshi

    -InDesign efficient Solutions

    MetaDesign - Solutions

    http://metadesignsolutions.com/services/InDesign-development.php

  • Saving InDesign CS4 to InDesign CS2 files

    I'm about to upgrade CS3 to CS4 but do create a customer who needs to open InDesign CS2 documents. I saved files for this customer to the interchange (.inx) of CS3 format, which worked well. But the .inx CS4 files won't open in CS3. A work-around, I found was at TUAW (http://www.tuaw.com/2009/05/08/tuaw-tip-saving-indesign-cs4-files-for-indesign-cs2/), which suggests to open the .inx file in a text editor and change the version number. The resulting file should then open in CS4. I was wondering if anyone has tried this (with or without success) or has advice on saving CS4 docs for CS2? Thank you very much!

    I am just posting on the offhand chance that Peter is not going to be enough hard.

    The best choice: anyone using CS4

    2nd best: everyone using CS2

    3rd best: CS4--> INX-> CS3->-> CS2 INX

    4th best: editing the INX CS4 in a text editor and it opens directly in CS2

    That last work, in general, if you only use tools that are in CS2, but it's a hack of Rouxel-Ribbon for ducts that I wouldn't trust unless I found myself stuck between the proverbial rock and hard place.

  • I don't want documents saved on the app [Android]

    In our company we have used the "Adobe Reader" app on android tablets. It works with our ERP and we generate a PDF through the app. The document, once sent by mail should be eliminated from the app. Instead, each unique document is saved on the app. How can I cancel this function? It's very urgent because are very confidential files and can't stay on the app.

    The documents may not be recorded on the app. Only a link to the doc must appear in the recent tabs and the Document Cloud in the selector position. The document is in fact the clouds of Document.

    If something different happens for you, after return.

    HTH,

    Ben

  • app.activeDocument.activeDataset.name

    Hello

    I have set up an action that I use for my batch process. I have to iterate over the [i] data sets that have unique names. I am trying to determine the name of the current index [i] data sets. I am able to read the name like this:

    Alert(App.activeDocument.dataSets[0].) (Name) / / It only reads the name of the dataset to [0] for each iteration. myset_0, myset_0, myset_0, myset_0, myset_0, myset_0, myset_0...

    The problem is that what I call for the batch using the dataset object. I can't delete the dataset from scratch, because she's going to change the length and spoil the batch.

    I want to do it like this:

    Alert (app.activeDocument.activeDataset.name); myset_0, myset_1, myset_2, myset_3, myset_4, et_5, myset_6 mys...

    but I get undefined.

    I don't know what the problem with this syntax:

    app.activeDocument.activeDataset.name

    Thank you

    Aubrey

    Try:

    app.activeDocument.activeDataSet.name;

  • Do my indesign ebook apps for tablets

    I searched in Indesign to make a highly interactive ebook.

    Last last question before I dive in head 1.

    What should I do an indesign ebook apps for iPad and Android tablets?

    Thanks for your time

    You can't do a "inDesign ebook" in an application. You can export an InDesign project in ebook format, but it will not be an app.

    You can make an interactive application with InDesign using plugins DPS. If you have clouds Creative entry, you will be able to create applications as simple as desire, but they will only be only iPad apps for iOS app store. In addition, you must purchase the 1-year subscription for iOS Apple Developer for $99, to be able to deliver your apps to the Appstore.

    If you wish to publish both Android applications, you will need to purchase Adobe DPS Professional Account.

  • How to create indesign using Java Script

    I am new to indesign and want to create indesign application using JavaScript.

    When I use AppleScript to create the Application Indesign I use this statement

    Tell application "Adobe InDesign CS5.5"

    myDocument to make document with the properties of the value

    tell the end

    Application InDesign create successfully.

    How to create the Application Indesign using JavaScript?

    or what is set equivalent to (tell application "Adobe InDesign CS5.5") in Java Script.

    There is a sample java script given on the forum or in the sdk. These departure example with app.

    When I debug these java script using ExtendScript ToolKit 3.6 it gives error on app (application not defined). I think that this app AI application object.

    How to create indesign application object app in javascript?

    Although this script runs successfully when I put these script in C:\Program Files\Adobe\Adobe InDesign CS5.5\Scripts

    and executing these script use the Scripts panel (choose window > utilities > Scripts), and then double-click the script name in the Scripts panel in indesign application. But in this case I have indesign application start and then choose window > utilities > Scripts, and then double-click the script name in the Scripts panel.

    I want to create Application Indesign (instance), using JavaScript.When I run or (debug) my JavaScript in any javaScript tool as ExtendScript ToolKit 3.6 then Indesign application should start, as in the Apple Script.

    Thank you

    long story short... NO!

    However, if you run the script from ESTK, you need not copy the script in the folder "Scripts". Do not know exactly if that's what you want.

  • app.activeDocument.revert ();

    I know that this will be easy, but it drives me crazy!

    app.activeDocument.revert ();

    give me a cancel / Restore dialog box

    I just want back. Don't ask me if want to come back.


    Help, please.

    Thank you

    Tell InDesign to shut up and do what it is told. (After that, however, you can find out if she has something to complain.)

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    app.activeDocument.revert();
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    
  • WIN 7 cannot find cmd or command prompt on WIN 7. Using the search box

    Cannot find cmd or command prompt on WIN 7. Using the search box

    Shirley

    You do not search to access the command prompt. Select Start, all programs, accessories, right-click right-click command promptand click run as administrator on the menu drop down.

  • Is legal to use "slmgr-rearm" extend using period in Windows 7 Ultimate & may I re-install Win 7 and use it for 30 days after the expiration date (29 days)?

    Hello
    I live in Iran.
    Here access to the original windows is not easy.
    I have ultimate edition (eternity) win 7.
    He let me to use during 30 days three times use "slmgr-rearm" to extend the trial period.
    Hereby, I can use and update.
    I have two questions.
    1. is legal to use "slmgr-rearm" extend with period?
    2-may I have reinstall win 7 and use it for 30 days after the expiration date (29 days)?

    with speciall thank you

    original title: Reinstall windows 7 ultimate

    According to the software Microsoft Windows 7 license, you must activate Windows 7 within 30 days of installation.  You are not allowed to circumvent or bypass the product activation.  After 30 days, you must enter a genuine Windows 7 product key for the edition you have installed, or remove Windows 7 by reformatting the hard drive, on which it is installed.

    In addition, you must respect Export Basics.

  • BlackBerry smartphones can not use APP World

    Hello world

    I have a problem with my BB tourch 9800 and I already have the blackberry service, but I can not use APP World when I open it I get this message (blackberyy APP World is not currently available in your country. Please check blackberry.com appworld for updates). so is there another way to download and install blackberry applications?

    not: iam in Iraq

    operator: Asiacell

    Hello and welcome to the community!

    Please check this page to ensure that you meet the minimum requirements (including if it is available in your country):

    If it is available in your country and you feel you meet the requirements at the level of the device, and then contact your provider to make sure you meet the requirements of the plan (to them) access (via their network) service to AppWorld.

    In addition, the latest version of the AppWorld is currently accessible only through your corporate data network - WiFi is not used for access to AppWorld under any circumstances. Therefore, you must subscribe to a sufficient level data plan so that the AppWorld to function.

    • KB23854"a data plan is required to use this feature" sometimes appears in BlackBerry App World

    Further still, you should know that AppWorld is simply a portal, vending apps developed mainly by others. Therefore, it is not your exclusive supply source - there are others that you can try:

    • AppWorld in some countries
    • MobiHand worldwide
    • Handango worldwide
    • BPlay worldwide
    • GetJAR worldwide

    I found that there are very few applications that is exclusive to AppWorld. You can see the online catalogue and then look for other sources of supply, including quite often on the developer website.

    Finally, understand that RIM has no unilateral control over the availability of AppWorld. They must ensure that they and their partners meet local laws and operating a system of e-commerce legislation - and that can take time. AppWorld is in more than 110 countries now and adding more every month.

    Good luck!

  • Cannot download Google game, a lot of useful apps that are banned!

    Microsoft open to RT as well? Several useful app such as The Star ePaper, WeChat, Myfm (radio station of the Malaysia) are not accessible.

    Google is only for Android devices, in the same way that the iTunes Store is only for Apple.

    If you want specific applications for the Surface, you need to contact the developers involved and ask them if they have plans to release applications for Windows RT.

Maybe you are looking for