Illustrator export script

Hi,
I was looking for a script that will allow me export to PDF with predefined PDF export preset.
I found this and I would like to instead of getting prompts which profile to choose (from the list), use that profile permanently (say it's number 7).
Also would be great if script would add to that exported file string of text at the end say like _exported1.pdf
Any ideas?
#target illustrator
if (app.documents.length>0){
var FolderRef = new Folder();
var folderResult=false;
try {
     FolderRef = FolderRef.selectDlg("Folder to save your PDF");
if (FolderRef!=null){folderResult=true;}
} catch (e) {
     alert("! Error on selecting folder:\n"+e+" !");
     folderResult=false;
var list=app.PDFPresetsList;
var Plist='';
for (var i in list){Plist+="\n"+i+" : "+list[i]}
var pIndex=prompt ('Choice your PDF preset by number'+Plist,10);
for (i=app.documents.length;i>0;i--){
     var PDF = new PDFSaveOptions();
     PDF.pDFPreset =list[pIndex];
     var saveName = new File (FolderRef+"/"+documents[0].name);
     documents[0].saveAs(saveName,PDF);
     documents[0].close();
alert ("Done!");
Peter

Pete Stan wrote:
... Unfortunately I am completely newbie when it comes to JavaScript ...
Where did the code come from then? Here perhaps? http://forums.adobe.com/message/2848958
Pete Stan wrote:
W_J_T your code gives me this error:     Error 8: Syntax error. Line: 1 -> # target illustrator
Sorry, that is just the "space" between # target, it should be no space #target (I auto-formatted with my text editor and it added the space, I didn't catch it)
Does the version below do what you want? It should deal with what "rama@adobe" mentioned above, sorry I didn't look close enough at the code before when posting.
#target illustrator
if (app.documents.length > 0) {
    var FolderRef = new Folder();
    var folderResult = false;
    try {
        FolderRef = FolderRef.selectDlg("Folder to save your PDF");
        if (FolderRef != null) {
            folderResult = true;
    } catch (e) {
        alert("! Error on selecting folder:\n"+e+" !");
        folderResult = false;
    var pdfPresetList = app.PDFPresetsList;
    // PDF Presets List # , 0 through Length
    var presetIndex = 7;
    // File name appended string
    var fileNameAppend = "_exported1"
    for (i = app.documents.length; i > 0; i--) {
        var PDF = new PDFSaveOptions();
        PDF.pDFPreset = pdfPresetList[presetIndex];
        // Get the file name minus the file extension, also remove spaces and replace with underscores
        var fileName = app.documents[0].name.substr(0, app.documents[0].name.lastIndexOf('.')).split(' ').join('_');
        // Combine the fileName with the fileNameAppend plus the .pdf file extension (the extension part however is probably is not needed and can be removed)
        var saveName = new File(FolderRef + "/" + fileName + fileNameAppend + ".pdf");
        documents[0].saveAs(saveName, PDF);
        documents[0].close();
    alert("Done!");

Similar Messages

  • Import of variables from XML fails, diff shows no difference from Illustrator export

    Hi, all,
    I've got an AppleScript that I wrote to massage CSV output from Excel into a variable library that I can import into Illustrator. Because I have to maintain black and white and left and right specific image files and output files, I've tried every other solution, and this is the best I've been able to come up with.
    diff reports that comparing the output to output of the identical data set exported from Illustrator is a 1-1 match. (I previously identified a place where there was an extra space.)
    Illustrator rejects the file with the "The incoming variable library is invalid." error message.
    If I copy and paste the contents of the output of my script into the file Illustrator exported, Illustrator reads it back, so my XML is correct.
    I'm using Illustrator CS2 and 10.4.11. Does Illustrator set some kind of creator code on the file? Is there something else that could be at work?

    hi, i am still having lo luck with reading the xml data back into memory, as i have said before, the netbeans profiler is telling me it is a char[] that is using 50% of the memory but i cannot see how a char[] is created, my code doesn't so it must be the xml code...plz help

  • Export script for .jpg and/or .tif

    hi,
    i'm quite proficient with java script and action script - now also getting into scripting illustrator. i'd like to write a script to export each layer of an open document as a separate .jpg and/or .tif file.
    apparently though, there is no way to access the resolution depth property (i need 300dpi) or the format method property (i need baseline optimized).
    can that really be true? only 72dpi output possible? no full property access?
    thanks a lot for any hint, maybe there are some strange workarounds?

    // http://hicksdesign.co.uk/journal/illustrator-exporting-layers-to-png<br /><br />var document = app.activeDocument;<br />if(document)<br />{     <br />    folder = document.fullName;<br />     var options = new ExportOptionsPNG24();<br />     options.antiAliasing = true;<br />     options.transparency = false;<br />     options.artBoardClipping = false;<br />     <br />     var n = document.layers.length;<br />     for(var i=0; i<n; ++i)<br />     {<br />          hideAllLayers();<br />          var layer = document.layers[i];<br />          layer.visible = true;<br /><br />//          var file = new File(folder.fsName+"-"+layer.name+".png");<br />//          Truncated for MAC<br />          var file = new File(document.path+"/"+layer.name+".png");<br />          <br /><br />          document.exportFile(file,ExportType.PNG24,options);<br />          <br /><br />     }<br />     <br />     showAllLayers();<br />}<br /><br />function hideAllLayers()<br />{<br />     forEach(document.layers, function(layer) {<br />          layer.visible = false;<br />     });<br />}<br /><br />function showAllLayers()<br />{<br />     forEach(document.layers, function(layer) {<br />          layer.visible = true;<br />     });          <br />}<br /><br />function forEach(collection, fn)<br />{<br />     var n = collection.length;<br />     for(var i=0; i<n; ++i)<br />     {<br />          fn(collection[i]);<br />     }<br />}

  • Adobe Illustrator Export to JPEG (*.JPG) vs ICC Color Profiles vs Behance

    Hi,
    I work with Adobe Illustrator CC 2014. When I export my projects into *.JPG format (using both: 'Adobe Illustrator > File > Export' and 'Adobe Illustrator > File > Save for Web') I use ‘Embed ICC’ profile option. Every common image viewer I use (including web browsers and Adobe Bridge) respects those color settings and displays exactly what has been embedded. But when posting on Behance, my color settings are converted into something else! The only solution is to place my Adobe Illustrator file into a new Adobe Photoshop document , then export it into .JPG (with embedded color settings) and then post it to Behance. With this workaround my colors look pretty correct.
    Did someone experience the same and  could explain why Behance doesn’t respect the Adobe Illustrator export with embedded ICC profile settings?
    one thing more – even if my *.JPG produced with Adobe Photoshop (the correct one)  is displayed correctly, the cover photo (taken from the original) is still converted into different (Behance’s default??) color space. I believe this shouldn’t work this way. Is there any workaround to this? Is there any way my covers (miniatures) display the 'true' colors?
    Please advise
    Best Regards,
    Pawel Kuc
    ccmutants.com

    ok. I give up. It seems that Adobe Illustrator can export only to the JPEG File Interchange Format (JFIF) and Behence doesn’t fully support this format (for example it cannot read its icc color data correctly):
    (JPEG) Formally, the EXIF and JFIF standards are incompatible. This is because both specify that their particular application segment (APP0 for JFIF, APP1 for Exif) must be the first in the image file. In practice, many programs and digital cameras produce files with both application segments included. This will not affect the image decoding for most decoders, but poorly designed JFIF or Exif parsers may not recognize the file properly (http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format#Exif_comparison)
    I’ve analyzed my files using JPEGsnoop 1.6.1 (really cool app by Calvin Hass, http://www.impulseadventure.com/photo/) and here is what I’ve found:
    A) *.jpg produced with Adobe Illustrator > File > Export > JPEG > ICC profile embedded:
    *** Marker: SOI (xFFD8) ***
    OFFSET: 0x00000000
    *** Marker: APP0 (xFFE0) ***
    OFFSET: 0x00000002
    length     = 16
    identifier = [JFIF]
    version    = [1.2]
    density    = 72 x 72 DPI (dots per inch)
    thumbnail  = 0 x 0
    B) *.jpg produced with Adobe Illustrator > File > Save For Web > JPEG > ICC profile embedded:
    *** Marker: SOI (xFFD8) ***
    OFFSET: 0x00000000
    *** Marker: APP0 (xFFE0) ***
    OFFSET: 0x00000002
    length     = 16
    identifier = [JFIF]
    version    = [1.2]
    density    = 100 x 100 (aspect ratio)
    thumbnail  = 0 x 0
    C) *.jpg produced with Adobe Photoshop > File > Save As > JPEG > ICC Profile embedded
    *** Marker: SOI (xFFD8) ***
    OFFSET: 0x00000000
    *** Marker: APP1 (xFFE1) ***
    OFFSET: 0x00000002
    length          = 1320
    Identifier      = [Exif]
    Identifier TIFF = 0x[4D4D002A 00000008]
    Endian          = Motorola (big)
    TAG Mark x002A  = 0x002A
    EXIF IFD0 @ Absolute 0x00000014
    Dir Length = 0x0007
    [Orientation ] = Row 0: top, Col 0: left
    [XResolution ] = 720000/10000
    [YResolution ] = 720000/10000
    [ResolutionUnit ] = Inch
    [Software ] = "Adobe Photoshop CC 2014 (Windows)"
    [DateTime ] = "2014:08:02 17:21:15"
    [ExifOffset ] = @ 0x00A8
    Offset to Next IFD = 0x000000D4
    EXIF IFD1 @ Absolute 0x000000E0
    Dir Length = 0x0006
    [Compression ] = JPEG
    [XResolution ] = 72/1
    [YResolution ] = 72/1
    [ResolutionUnit ] = Inch
    [JpegIFOffset ] = @ +0x0132 = @ 0x013E
    [JpegIFByteCount ] = 1006
    Offset to Next IFD = 0x00000000
    EXIF SubIFD @ Absolute 0x000000B4
    Dir Length = 0x0003
    [ColorSpace ] = sRGB
    [ExifImageWidth ] = 200
    [ExifImageHeight ] = 200
    So unfortunately the only option to produce the EXIF JPEG from an Adobe Illustrator project is to: Export *.ai file to JPEG (under Adobe Illustrator) > go to Photoshop > Create new project > Paste the *.jpg > and Sava As JPEG with icc embedded.

  • Export scripts

    I would like to know how to develop export scripts with suitable buffer size to preserve important tables before and after batch process (for bill processing ) using export utility / import utility

    Depends on what OS you are using. Google is your friend. Google tuning oracle exp or something to that effect.

  • How can get Information of Exfect in Illustrator by Script?

    Illustrator can setting Effect: Illustrator Effect, Photoshop Effect to Object,
    But i find in document not exist attributes can get their information.
    How can get Information of Exfect in Illustrator by Script?

     

  • Editing an export script - please help!

    Hello Photoshop friends,
    so I have an export script that I downloaded from the web which exports all layers to a file type of your choice - PNG, GIF, etc. This is fine, but the dialog box doesn't support file format options such as matte, dither, transparency and so forth. Is it possible to edit the script to give it literal values for these inaccessible variables instead of the default? I'v been digging around the script, but I'm not really sure what I'm doing.
    Specifically, I want to leave the script intact except the following settings for the PNG8 format:
    Colours 256
    Transparency - YES
    "No transparency dither"
    Matte: "none" (currently it gives me a white matte)
    Please, I would really appreciate if anyone could point me in the right direction please, please!
    Ulerika.

    Hey Michael, thanks for your quick reply. I tried to attach the script, but the forum won't allow me to do so. The script in question is here:
    http://tranberry.com/photoshop/photoshop_scripting/tips/layerstoPNG.html
    There is one big section dealing with PNG8 which I suspect is the place which needs to be changed. An extraction from this section for example reads:
    "var id35 = charIDToTypeID( "Mtt " );
    desc4.putBoolean( id35, true ); //matte
    var id36 = charIDToTypeID( "MttR" ); //matte color"
    Thanks.

  • Export scripts automation windows 2003 server

    i want some automatic export scripts that run a specific time on daily basis
    My platform is windows
    My Database is oracle 10g
    Please help

    1002643 wrote:
    i want some automatic export scripts that run a specific time on daily basis
    My platform is windows
    My Database is oracle 10g
    Please helpcreate *bat file & schedule using AT utility                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Use of Import and Export script

    Hi,
    Can any one tel me what is the use of Import and Export script.
    After moving the pages from / into server what is the need of giving the import / export command.
    export /oracle/apps/ap/setup/webui/customizations/site/0/SetupPG -rootdir <destination path> -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> (port = <port id>)))(connect_data = (sid = <sid>)))".
    Thanks in Advance,
    Jegan

    And Export/Import is also used to move personalizations and substitutions from one system to another system.
    You can also use Functional administrator UI to export and import pages.
    Functional administrator in turn uses export/import internally.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • New tutorials and export script

    Hey All,
    As much as I loves me .Mac account for its ridiculously easy iPhoto publishing, I've reached the point where I want to be able to have fun with server-side scripting (PHP, Ruby, etc.), so I've moved the tutorials and such to a new location:
    http://www.motionsmarts.com
    I've got a couple of new tutorials there, as well as an AE-to-Motion position keyframe export script, for those of you desperate to move that tracking data. It's no-frills, but it seems to work well enough.
    Have fun, and please post if you find any errors or typos. Thanks!

    Amazing, Specialcase!
    Will try the AE position exporter as soon as possible!
    Keep those great things coming
    PS: Do you think it would be too hard for a non programmer like myself to customize the script? I would love to modify it to export Soundkeys or AE's built-in Convert audio to keyframes data to Motion! I mean, I could copy that data to AE's position and then export, but position has two dimensions and the audio level data is unidimensional....
    Thanks again.

  • Genralizing the data export script

    hi , i have a data export script which is a busienss rule , now i can genralize the version, year, scenario and everything but the problem is that the export file that is being created has the fixed name , each time i run that rule the data export file will be same , is it possible to somehow genralize that export file name as well.

    hi here is some java which i have used earlier try to modify ...it saves with current date and time and even i used SED all this in UNIX
    JAVA
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileFilter;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.InputStreamReader;
    import java.io.Writer;
    import java.util.Calendar;
    import java.util.StringTokenizer;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    * @author KVC
    public class MigratorUtil {
         public static File getLatestFile(String dir){
              File directory = new File(dir);
              File choice = null;
              if(directory.isDirectory()){
                   File[] files = directory.listFiles(new FileFilter() {
                        public boolean accept(File file) {
                             return file.isFile();
                   long lastMod = Long.MIN_VALUE;
                   int fileSize = files.length;
                   for(int i=0;i<fileSize;i++){
                        File file = files;
                        if(file.lastModified() >lastMod){
                             choice = file;
                             lastMod = file.lastModified();
              }else{
                   System.out.println(dir+" is not a directory");
              return choice;
         public static boolean processFile(File latestFile) throws FileNotFoundException,Exception{
              FileInputStream fileStream = new FileInputStream(latestFile);
              DataInputStream in = new DataInputStream(fileStream);
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String strLine;
              int lineCount = 0;
              StringBuffer contents = new StringBuffer();
              while((strLine = br.readLine())!=null){
                   if(lineCount == 0){ //first line
                        String header = System.getProperty("header");
                        if(header == null){
                             header = "HEADERHYPERION";
                        contents.append(header).append(getPreviousBusinessDate()).append(getDateFormat()).append("\n");
                   }else{
                        contents.append(strLine).append("\n");
                   lineCount++;
              //footer
              if(lineCount != 0){ //last line
                   String footer = System.getProperty("header");
                   if(footer == null){
                        footer = "TRAILER";
                   contents.append(footer).append(lineCount-1); // linecount - 1 to remove the first line count
              // wtite the file
              String fileName = latestFile.getAbsoluteFile().toString();
              String outputFile = fileName.substring(0,fileName.indexOf("."))+".out";
              System.out.println(" output file is ..."+outputFile);
              File output = new File(outputFile);
              Writer oWriter = new BufferedWriter(new FileWriter(output));
              try{
                   oWriter.write(contents.toString());
    //               oWriter.write(getProcessedLine(contents.toString()));
              }finally{
                   oWriter.close();
              return true;
         public static String getDateFormat(){
              Calendar calendar = Calendar.getInstance();
              int currentMonth = calendar.get(Calendar.MONTH);
              return calendar.get(Calendar.YEAR)+"-"+(currentMonth>9?""+currentMonth:"0"+currentMonth)+"-01";
         public static String getPreviousBusinessDate(){
              Calendar calendar = Calendar.getInstance();
              int currentMonth = calendar.get(Calendar.MONTH);
              calendar.set(Calendar.MONTH, currentMonth-1);
              int lastDate = calendar.getActualMaximum(Calendar.DATE);
              calendar.set(Calendar.DATE, lastDate);
              int lastDay = calendar.get(Calendar.DAY_OF_WEEK);
              if(lastDay == 1 ){
                   lastDate = lastDate - 2; // for sunday
              }else if(lastDay == 7){
                   lastDate = lastDate - 1; // for saturday
              return calendar.get(Calendar.YEAR)+"-"+(currentMonth>9?""+currentMonth:"0"+currentMonth)+"-"+lastDate;
         private static String getProcessedLine(String line){
              String seperator = System.getProperty("inputseperator");
              String out_seperator = System.getProperty("outputseperator");
              if(seperator == null){
                   seperator = "!";
              if(out_seperator == null){
                   out_seperator = "|";
              StringTokenizer tokenizer = new StringTokenizer(line,seperator);
              StringBuffer descContent = new StringBuffer();
              StringBuffer content = new StringBuffer();
              while(tokenizer.hasMoreTokens()){
                   String element = tokenizer.nextToken();
                   if(matchPattern(element)){
                        System.out.println("Criteria matched..."+element+ "So eat the next elemet");
                        descContent.append(tokenizer.nextElement()).append(out_seperator);
                   }else{
                        content.append(element).append(out_seperator);
              content.append(descContent);
              String output = content.toString();
              return output.substring(0, output.length()-1);
         private static boolean matchPattern(String line){
              String regex = "\\d{1,2}.\\d{1,2}.\\d{1,2}";
              Pattern pattern = Pattern.compile(regex);
              Matcher m = pattern.matcher(line);
              return (m.matches());
         public static void main(String a[]){
              System.out.println(getPreviousBusinessDate());
    SED
    for file to
    #!/bin/bash
    #Replace tab with pipe
    cat $1 | sed 's/\t/|/g' > /tmp/test.out
    line_cnt=`wc -l $1 | awk '{print expr $1-2}'`
    if [ `uname -s` = 'SunOS' ]; then
    set -A months 0 1 2 3 4 5 6 7 8 9 10 11 12
    else
    months=(0 1 2 3 4 5 6 7 8 9 10 11 12)
    fi
    here it takes last month date similarly u can change up to ur requirements
    YEAR="`date +%Y`"
    MONTH="${months[`date +%m-1`]}"
    TODAY_STR="`date +%Y`-${months[`date +%m`]}-01"
    DAY="`cal $MONTH $YEAR | awk '{ if(NF>1) a=$NF ; if (NF==7) a=$6}END{print a}'`"
    LAST_MNTH="`date +%Y`-${months[`date +%m-1`]}-$DAY"
    cat /tmp/test.out | sed -e "s/HEADERHYPERION/HEADERHYPERION${LAST_MNTH}${TODAY_STR}/" > /tmp/test_tmp.out
    cat /tmp/test_tmp.out | sed -e "s/TRAILER/TRAILER${line_cnt}/" > $2

  • Problems with Freehand Illustrator CS4 script for Macs

    A couple of us just downloaded the new Freehand to Illustrator CS4 script for Macs that was released on 5/17/10. Sometimes it works okay, but more often than not we get errors like 'ERROR: 1, Access is denied'. If we instead just open the Freehand file, the file comes in fine. What have been other people's experiences using this new script?
    Mac OS X 10.5.5

    Is the problem there only at the time of conversion or even the FH files are not opening after running the script
    Here is what I have done and may be you can follow the exact steps :
    1) Create a folder FH on Desktop and paste only the FH files in the folder( My folder does not contain any other file apart from FH files)
    2) Create a Folder AI  on Desktop and keep it empty
    3) File-> Scripts-> FreehandToAI
    4) Select the source folder( FH)
    5) Now select the destination folder(AI)
    It gives the message after conversion "N freehand files are converted to AI".

  • Illustrator Export Help!

    Hey all,
    This is probably a stupid question but I'm in Illustrator and I'm trying to export a project to .jpg, but when I do, I have images sticking out of the artboard borders. there's a huge white border around my artboard. How do I crop the final image, or export so only the items on the artboard are seen?
    Any help would be great!
    Courtney

    You need a script to clip to artboard.
    This is only a code segment, need to be tested its a start.. the last line has the
    "export current document to file export_File_Path as JPEG with options {class:JPEG export options, quality:80, horizontal scaling:700, vertical scaling:700, matte:false, artboard clipping:true}"
    -- Get the File Path of Current Illustrator File
    tell application "Adobe Illustrator"
      activate
      set current_Illustrator_document_Path to (file path of current document) as text
    end tell
    -- Get the Name of the File
    set text item delimiters to ":"
    set current_Illustrator_document_File to last text item of current_Illustrator_document_Path as text
    -- Create the Name we will export to
    set export_File_Name to ((text 1 thru -4 of current_Illustrator_document_File) & ".jpg") as text
    -- Get the Name minus file extension
    set export_Base_File_Name to (text 1 thru -4 of current_Illustrator_document_File) as text
    -- Parse the Size Code from file name
    set text item delimiters to " "
    set sizeCode to last text item of export_Base_File_Name as text
    -- Get the Containing Folder path from File Path
    set text item delimiters to ":"
    set fileLocation to text items 1 thru -2 of current_Illustrator_document_Path as text
    -- Guess the name Illustrator will actually export the file to (spaces become hyphens)
    set ourText to export_File_Name
    set findThis to " "
    set replaceItWith to "-"
    set newText to switchText of ourText from findThis to replaceItWith
    to switchText of theText from SearchString to ReplaceString
      set OldDelims to AppleScript's AppleScript's text item delimiters
      set AppleScript's AppleScript's text item delimiters to SearchString
      set newText to text items of theText
      set AppleScript's AppleScript's text item delimiters to ReplaceString
      set newText to newText as text
      set AppleScript's AppleScript's text item delimiters to OldDelims
      return newText
    end switchText
    set exported_File_Name to newText as text
    -- Guess the Path of the File Illustrator will Export
    set exported_File_Path to (fileLocation & ":" & exported_File_Name) as text
    -- Define the Name we Wanted Illustrator to export (with spaces)
    set export_File_Path to (fileLocation & ":" & export_File_Name) as text
    export current document to file export_File_Path as JPEG with options {class:JPEG export options, quality:80, horizontal scaling:700, vertical scaling:700, matte:false, artboard clipping:true}
      end tell

  • Exchange 2010 GAL Export script working from EMS but not as a scheduled task

    I have been asked to get a script together to export the GAL on an Exchange 2010 server and then email it to a manager. I have been playing it with days, and have pruned it to the very minimum to at least try and get it working before improving it. At the
    moment I have the text as below:
    Del c:\GALexport.csv
    Get-Recipient -ResultSize unlimited | where {$_.HiddenFromAddressListsEnabled -eq $false} | Select DisplayName,PrimarySMTPAddress,sAMAccountName,alias | Export-Csv "c:\GALexport.csv"
    This works just fine in Exchange Management Shell and deletes the previous report before creating a new one. However, when I set it up as a scheulded task, it does nothing.
    The task is set up as follows:
    Action - Start a Program
    Program/ Script C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe
    Add arguments -version 2.0 -NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; d:\Scripts\GalExportReport.ps1"
    This is set to run under my administrator account with the highest privileges and I have the logon as batch right.
    Unfortunately, when I run it as a scheduled task, nothing happens. The last run result is (0x0) and in the history it says 'task completed', but no report is produced. Can anyone advise please?

    Does it delete the c:\GALexport.csv file? If not, then its not even executing the ps1 script...
    - Open cmd prompt and run below command to confirm that there isn't any typo or any other small error...
    C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version
    2.0 -NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; d:\Scripts\GalExportReport.ps1"
    - If above works then something wrong with task scheduler configuration...
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • Creating Multi-Page PDF from a Layerd Illustrator file (script)

    Often times when designing a logo I create different versions and variable options on layers. This can result in several layers in one Illustrator file. Is there an easy way or an existing script that will allow me to (with one click) create a multi-page PDF consisting of all the layers within my .ai file? The current method is turning on each layer, performing a save-as (PDF), then turning off said layer and turning on the next layer and repeating the task and so-on-and-so-forth, etc … It becomes tedious and quite often I save over the previous version, forgetting to re-name it or forget to perform a save on a certain layer. Can anyone help with some advice? I have never written my own script before but am not opposed to trying, where do I begin?
    Any help is appreciated.

    You don't say what OS you are using and which scripting language you are thinking of doing this in…
    This is a sample that may get you started done in JavaScript so it's platform independent with the exception of my 'mac style' file paths.
    If your on a PC it may just be a typo to set to C drive or whatever you call them things…
    If you are on the mac OS then it should just dump a load of PDF's on your desktop.
    You say about a multi-page PDF but don't think Illustrator can do this unless its been added with multi-artboards in CS4?
    Others would have to let you know that…
    #target illustrator
    var docRef = app.activeDocument;
    with (docRef) {
    var docName = baseName(name)
    var pdfOptions = new PDFSaveOptions();
    pdfOptions.pDFPreset = '[High Quality Print]';
    // Turn all layers off
    for (var i = 0; i < layers.length; i++) {
    layers[i].visible = false;
    // Turn each layer on
    for (var i = 0; i < layers.length; i++) {
    if (i == 0) {
    layers[i].visible = true;
    redraw();
    var layerName = layers[i].name;
    var saveAsPath = new File('~/Desktop/' + docName + '_' + layerName + '.pdf')
    saveAs(saveAsPath, pdfOptions);
    } else {
    layers[i-1].visible = false;
    layers[i].visible = true;
    redraw();
    var layerName = layers[i].name;
    var saveAsPath = new File('~/Desktop/' + docName + '_' + layerName + '.pdf')
    saveAs(saveAsPath, pdfOptions);
    //close(SaveOptions.DONOTSAVECHANGES);
    function baseName(fileName) {
    var nameString = '';
    var extOffset = fileName.lastIndexOf('.');
    if (extOffset == -1) {
    nameString = fileName;
    } else {
    nameString = fileName.substr(0, extOffset);
    return nameString;

Maybe you are looking for

  • Doubt in thread handling

    I have a doubt in the thread mechanism..... Below is a sample of the class public class SimpleThread extends Thread { private int countDown = 5; private static int threadCount = 0; public SimpleThread() { super("" + ++threadCount); // Store the threa

  • Can't invite people to events in iCal

    I'm having problems inviting people to attend events in iCal on my Macbook Pro. It works fine on my iMac through a MobileMe subscription and through MobileMe the two computers and my iPhone sync perfectly. When I try and send out the invitations, it

  • ORA-00001 Unique constraint Violation Error

    We are upgrading our NW BW 7.01 java server to 7.3 and during the Downtime phase of the Installer, while running the Offline Migration, we are getting an error "EP-KM-BC: Unique Constraint Violation error: ORA-000001".  Unknown Object# (12xxxxxx) doe

  • Insert a Speakable Phrase in Applescript

    Can anyone tell me how to insert a speakable phrase into an applescript script. I would like to run a script and all it does is speak the pharse I have written in the script. Not run a sound.app or play a recorded clip. But speak a line of text that

  • Open 16 bit files, as default

    Hello, all. I'd like to have ACR open files as 16 bit, as a default setting.  Where might I change the default setting to this?  I didn't see it in the preferences, unless I'm missing something. Each file has the option, when opened, to open as eithe