How Save File using script ?

Hi Expert
I am using MAC OSX 10.8.3 and InDesign CS5.5
I use this script to save the InDesign file and run this script using Adobe ExtendScript ToolKit CS5.5
#target indesign
var myDocument=app.activeDocument;
myDocument.save(File("/var/New.indd"));   
But Script give error
can not save "untitle1.indd" under a new name
where "untitle1.indd" is created indesign file name.
Is it Script proble or InDesign problem
or
MAC OSX problem ?
How save file  ?
Thanks.

Bill joy wrote:
Is it Script proble or InDesign problem
or
MAC OSX problem ?
Hi Bill,
I think it is your path problem. (Are you able to save this file in UI there?)
Check:
mFile = new File("/var/New.indd");
mFile.isValid;
You can't go forward until above == true;
You could check how your system records a path using this in ESTK:
mFile = File.saveDialog();
select any file and check ESTK console.
Script is creating a new File object with path you can see (not saving anything), so do it same way.
If you will pass above with true save a doc using:
mDoc.save(mFile);
Jarek

Similar Messages

  • How to call text file using Script in Data Integrator

    Dear All,
    Can any one assit me in how to call a text file using script with the help of Data Integrator.
    and one question ?
    M having 32 csv files i want to club thos 32 csv files into one table with the help of Data Integrator, can
    any one assist me.

    mary,
    since you knew the file name ,when clicked in name send to server,read the file and write to servlet outputstream.
    I think this would help you.
    If anything wrong in mycode ..forums will help you further
    BufferedInputStream bis=null;
    BufferedOutputStream bos=null;
    int bytesRead=0;
    byte buff[]=new byte[1024];
    File f=new File(test.txt);
    try{
         bis= new BufferedInputStream(new FileInputStream(f));
         bytesRead=bis.read(buff,0,buff.length);
         if(bytesRead!=-1){
              // create a BufferedOutputStream from ServletOutputStream
              bos=new BufferedInputStream(response.getOutputStream());
              do{
                   bos.write(buff,0,bytesRead);
              }while((bytesRead=bis.read(buff,0,buff.length))!=-1)
    }catch(Exception e){
         ////error handling
         }

  • When i save files using CS6 files go white

    When I save files using CS6 and try to view them in other program (i.e. iPhoto, etc) the files show as a white box with no image. I'm using a Macbook Pro with Yosemite.

    Most likely you have "maximize compatibility" off, and are using applications that can only read the composite image (which requires maximize compatibility ON).

  • How to embed images in an INX file using script

    Hi All,
    Kindly help me in embedding images in INX file using Indesign Javascript.
    I have used the following code to embed images in an indd document and exporting that document to inx. But the images in inx are not embedded by default.
    var linksCount = myDocument.links.count();
    var linksOnPage = myDocument.links;
    for(var x=0;x<linksCount;x++){
        var linkedItem = linksOnPage.item(0);
        linkedItem.unlink();
    myDocument.save(new File("filename.indd"));
    myDocument.exportFile(ExportFormat.INDESIGN_INTERCHANGE, File("filename.inx"), app.pdfExportPresets.item("[Press Quality]"));
    Thanks in advance,
    Anitha

    Hi
    I think your script has two mistakes
    you embed only first link image in for loop => set x for linksOnPage
    exporting to inx isnot need PDF export preset => remove app.pdfExportPresets.item("[Press Quality]") from exportFile()
    this work for me.
    myDocument = app.documents[0];
    var linksCount = myDocument.links.count();
    var linksOnPage = myDocument.links;
    for(var x=0;x < linksCount;x++){
        var linkedItem = linksOnPage.item(x);
        linkedItem.unlink();
    myDocument.save(new File("filename.indd"));
    myDocument.exportFile(ExportFormat.INDESIGN_INTERCHANGE, File("filename.inx"));
    thank you

  • How can I use script change long list format?

    Hi everyone
    If I have this kind of long list
    0101
    Long white radish
    Chinese Celery
    Tah tsai
    Round cucumber
    Cherry radish
    fennel
    Small-leaf arugula
    Small wax gourd
    0102
    Green-leaf Lettuce
    Broad-leaf arugula
    UFO squash
    Crystal radish
    Red wave lettuce
    Green endive
    Sponge gourd
    Rose-heart radish
    Butter head lettuce
    Radicchio
    0103
    Chinese mustard
    New Zealand spinach
    Yellow summer squash
    Turnip
    Malabar spinach
    Chinese kale
    Green bean
    Edible rape
    Begonia fimbristipulata hance
    Purple bean
    Cabbage
    Water Spinach
    Okra
    Snow peas
    How can I change the format into this:
    0101
    0101/Long white radish
    0101/Chinese Celery
    0101/Tah tsai
    0101/Round cucumber
    0101/Cherry radish
    0101/fennel
    0101/Small-leaf arugula
    0101/Small wax gourd
    0102
    0102/Green-leaf Lettuce
    0102/Broad-leaf arugula
    0102/UFO squash
    0102/Crystal radish
    0102/Red wave lettuce
    0102/Green endive
    0102/Sponge gourd
    0102/Rose-heart radish
    0102/Butter head lettuce
    0102/Radicchio
    0103
    0103/Chinese mustard
    0103/New Zealand spinach
    0103/Yellow summer squash
    0103/Turnip
    0103/Malabar spinach
    0103/Chinese kale
    0103/Green bean
    0103/Edible rape
    0103/Begonia fimbristipulata hance
    0103/Purple bean
    0103/Cabbage
    0103/Water Spinach
    0103/Okra
    0103/Snow peas
    by useing script?
    thanks
    Teetan

    Hi,
    Perhaps not a problem, try this code ...
    var myFolder=Folder("~/Documents");
    var sourceFile = new File(myFolder + "/"+"sourceFile.txt");
    var logFile = new File(myFolder + "/"+"logFile.txt");
    //var elementList = Array('0101','Long white radish','Chinese Celery','Tah tsai','Round cucumber','Cherry radish','fennel','Small-leaf arugula','Small wax gourd','0102','Green-leaf Lettuce','Broad-leaf arugula','UFO squash','Crystal radish','Red wave lettuce','Green endive','Sponge gourd','Rose-heart radish','Butter head lettuce','Radicchio','0103','Chinese mustard','New Zealand spinach','Yellow summer squash','Turnip','Malabar spinach','Chinese kale','Green bean','Edible rape','Begonia fimbristipulata hance','Purple bean','Cabbage','Water Spinach','Okra','Snow peas')
    //var newElementList = new Array;
    var myPattern = new RegExp("^\\d{4,4}$");
    var myPrefix="";
    if (sourceFile.exists){sourceFile.open( 'r' );
    while( !sourceFile.eof ) {
              var aElement  = sourceFile.readln();
              if (myPattern.test(aElement)){
                  //newElementList.push(aElement);
                  myPrefix = aElement + "/";
                  writeLogFile(aElement)
              } else {
                   //newElementList.push(myPrefix+ aElement);
                   writeLogFile(myPrefix+ aElement)
        //$.write(newElementList);
    function writeLogFile(theString) {
        logFile.open( "a" );
        logFile.writeln(theString);
        logFile.close();   

  • Strange noise problem with music layer after replacing the music file using script in CS6

    Hey guys,
    I got a strange problem. Sometime when I import a music file, or replace a music footage with another music file using the "replace()" or "importFile()" method, the music layer added one second noise at the beginning. like this,
    Does anyone know what's going on here?
    I'm using After Effects CS6 windows Server 2008 64bit.
    Thanks in advance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi Myleniu,
    Thanks for your replay. Actually, it doesn't matter what makes up my comp, this problem just randomly happen when I render any comp. For example, I have a comp named "noise", I run a script to replace the music then render it, I use a "for" loop to do this 5 times and the music noise problem just happen one time.
    I'm starting to think that win server might be the problem.

  • I am receiving an error message every time I try to save files using QuickOffice Pro.  Any advice on what I might be doing wrong?

    I am receiving an error message that it is unable to save my file everytime I try to save a file using QuickOffice Pro on my iPad.  It seems like I must have missed a setting or something someplace but I can't figure it out. 
    Any advice? 
    Thanks!

    Make sure that the network.protocol-handler.external.javascript has the default value (false).
    *<b>about:config</b> page: <b>network.protocol-handler.external.javascript</b> = false
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config
    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Can't properly save and use script (Perl) files

    I can't get Perl scripts in my path to properly run under Mac OS X (10.5.2). I'm using Smultron to edit the files, and have also taken them into nano via Terminal and saved both as DOS and Mac formats. When I save as DOS, I get this when I run the file:
    /usr/bin/perl^M: bad interpreter: No such file or directory
    I assume it's having problem interpreting the DOS CR/LF character and shows "^M" as a result. When I save in "Mac" format, the script does nothing (not even an error) when I run it. If I cat the Mac formatted script, it doesn't display properly:
    $ cat perlscript.pl
    $ FG,SWITCHCFG); shutports/ig) {(.+)/ig) {
    (You're seeing a tiny portion of the script there; not even the end of it - but that's all it shows.) If I save in the DOS format, I can workaround the problem by running it as "perl path/scriptname.pl"; this eliminates the misinterpretation of !#user/bin/perl^M above. What am I doing wrong? Can I not run perl scripts that are in my path without typing the longhand "perl pathlist/filename"? Thanks.

    Yes, it's executable; it tries to execute either way.
    The Unix LF through Smultron seemed to work. However, I don't see such an option in nano - only Mac and DOS. (I'm not too concerned, I'm pretty sure I"ll use Smultron on a regular basis to edit these files.)

  • How I can open Labview6.1 files form Labview5.1, or how to save file using 6.1 in order to open it by 5.1

    I tried "save with options" but there are only 6.0/6.1 versions but no prior. How I can convert files from LV6.1 to LV5.1?

    You will at least need LV 6.0.X to do the conversion IF POSSIBLE!
    There were many features and functions added between 5.1 and 6.1. None of these are backward compatible.
    If you have 6.0.x then first do a save for previous from 6.1 the 6.0.x then repeat uisng LV 6i.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How do we use Script (batch file with msbuild/msbuild project) to build Cordova Project created with Visual Studio Tools for Apache Cordova?

    I use Visual Studio to create Cordova projects. I need to build Cordova projects using msbuild and buildbot via script for my project but I can find only information about how VS combine with Cordova CLI to build multi device hybrid application.

    Hi Samseth,
    Yes, correct, the only thing we can find on the MSDN is:
    Deploy and Run Your App
    And that's the reason why Visual Studio Tools for Apache Cordova existing.
    I think you may get more detail compile information from here:
    http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Getting error message when i am trying to update the excel file using script task in ssis package

    Hi Guys,
    I am getting error message when I am trying to update the excel. Please find the error messages as below
    Error at Update File [Update File]: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.
    Error at Update File [Update File]: BC30002 - Type 'Microsoft.Office.Interop.Excel.Application' is not defined., ScriptMain.vb, 32, 32
    Error at Update File [Update File]: BC30002 - Type 'Microsoft.Office.Interop.Excel.Workbook' is not defined., ScriptMain.vb, 33, 25
    Error at Update File [Update File]: The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.
    Warning at Update File [Update File]: Found SQL Server Integration Services 2008 Script Task "ST_050fcae972904039b4f0fe59b7528ece" that requires migration!
    and the code that   I am using is
    Dell - Internal Use - Confidential
    ' Microsoft SQL Server Integration Services Script Task
    ' Write scripts using Microsoft Visual Basic
    ' The ScriptMain class is the entry point of the Script Task.
    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Runtime
    Imports Microsoft.Office.Interop.Excel
    <System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="",
    Description:="")> _
    <System.CLSCompliantAttribute(False)> _
    Partial
    Public Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    Enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End Enum
    Public Sub Main()
            Dts.TaskResult = ScriptResults.Success
    'Dim proc As System.Diagnostics.Process
    'kill all instances of excel
    'For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")
    ' proc.Kill()
    'Next
    Dim excelnacomm As
    New Microsoft.Office.Interop.Excel.Application
    Dim wbnacomm As Microsoft.Office.Interop.Excel.Workbook
            wbnacomm = excelnacomm.Workbooks.Open("http://test.xlsx")(renamed
    the excel)
            wbnacomm.RefreshAll()
            wbnacomm.Save()
            wbnacomm.Close()
            excelnacomm.Quit()
            Runtime.InteropServices.Marshal.ReleaseComObject(excelnacomm)
    End Sub
    End
    Class
    Please let me know what could be the reason
    Smash126

    Download:
    Microsoft Office 2010: Primary Interop Assemblies Redistributable
    How to: Add or Remove References By Using the Add Reference Dialog Box  /  How to:
    Add and Remove References in Visual Studio (C#)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How do I use scripting to set an object location?

    Hello,
    I have an "X" text object that I would like to change its (x,y) location on my .pdf form based on values that the .pdf user places into (2) separate decimal fields.
    For Example:
    If User enters for example 3.1 and 2.5 into the two decimal fields the location of the "X" object would be:
    Xcoordinate = constant1 * 3.1 + constant 2
    Ycoordinate = constant3 * 2.5 + constant 4
    Does anyone have an idea on how I might be able to accomplish this using the script editor in LiveCycle Designer or some other method?
    If not, is there a way for me to make the "X" movable (by dragging) by the end user who will not be using LiveCycle Designer?
    Thanks,
    Chris

    Hi,
    you can manipulate the x and y on any object as long it's placed in a positioned page or subform.
    The simply use a FormCalc script in the change event of your numeric fields to change the desired property.
    For the x property it could look this way.
    Textfield1.x = Concat($event.fullText, "mm")
    Note: The x and y property accepts 4 different measurements (in, mm, cm and pt).

  • Save file with script (skip warning 'modified outside Illustrator')

    Hi All,
    We all know that command:
    app.activeDocument.save();
    saves the document skipping all the dialogs and even alert that is popping out every time when you manually saving your file on a server:
    My issue is that I am working on PDF files (with preserved Illustrator editing capabilities) almost all the time rather than .ai files, and everytime I use
    app.activeDocument.save();
    The .ai file is created.
    My question is if it's possible to save PDF that you're working on same as you would manually 'Save' from the menu context, ommiting that annoying dialog about modified file?
    Regards
    Peter

    You should be able to "SaveAs",  specifying the PDF as the type and choosing to not invoke the dialog box.
    Hope this helps!  -TT

  • Copy / Save files using Bridge

    I have bridged my BB Curve 9360 with my Playbook (OS 2.0.1.668) today.
    I can access the Bridge Browser, MemoPad, Contacts, BBM, Messages and Tasks.
    Bridge Files does not appear on the Playbook Bridge section.
    Bridge FIles also does not appear on the phone in the Bridge app, only the other options listed above (browser, contacts etc.)
    When I use the File Browser on the Playbook, I can see the paired phone, and I can browse the flolders and open files (like JPGs) from it onto the Playbook.
    Is it possible to copy those files over to the Playbook? Even when I open them onto the Playbook, there is no option to save the image that I am viewing. 
    ** After further searching through the forums, I see this has been answered (no copy via bridge unless buying an third-party app (aftab?) )

    Files & Folders lets you do this, unless your smartphone is managed by BES. In that case, BES actively prevents you from copying files in an attempt to stop company data from being moved outside the corporate perimeter. Take the trial version of F&F for a spin to see if it works for you...
    Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands

  • Using IE 10 opening or trying to save file using the link cause IE to restart

    I am using IE 10 and adobe reader 11.0.4 . ie When I try to open or save a PDF I get a message IE has stopped and checking on line for solutions and then just restarts IE. I have checked a similar post which mentions editing the registery but when I check it doesnt have that setting. I am also using windows 7 32 bit.
    Cheers

    Does the problem occurs with any PDF?  Can you try opening this PDF: http://helpx.adobe.com/pdf/adobe_reader_reference.pdf? 

Maybe you are looking for

  • Tab not working on ALV report output in Persona

    In normal SAP GUI we can move the cursor position on ALV report output between different column by pressing TAB on keyboard. But in case of persona 2.00, TAB doesn't work and we have to click on each cell of the report output whatever we want to high

  • Microsoft Outlook doesn't work properly since I updated to Mavericks?!

    Hello.. so yeah ever since I updated to Mavericks, Outlook from Microsoft Office 2011 doesn's work properly. It won't pop up with a window to either reply, forward or write a new e-mail and it gets annoying because I need it for work. So it's totally

  • Anyone seen this error before in Applet Viewer?

    I was trying to run an application that runs fine in a web browser but this is what happens if I try to run it using the AppletViewer. This is how I was running the program: C:\AppletViewer MyApp.htm Exception in thread "main" java.util.MissingResour

  • Auscompgeek: Firefox 3.6.6 works, but 3.6.7 and 3.6.8 bring up a cannot connect issue

    Firefox 3.6.7 and 3.6.8 do not connect to the internet. I've been on Mozilla support, and no luck. I have tried everything that I can, it's left to the dev team to fix the problem for 3.6.9 else I just won't be able to use it ever again. 4.0b1 works

  • How to set female voice as software instrument?

    I want to use the GarageBand software keyboard to play female vocals (to use in practicing pitch matching). I can't seem to figure out how to do this. Maybe there's a plugin I need? I'm pretty technically competent, but a novice w/music sw. To be cle