[JS CS3/4] onEvent Export scripting question

Hi,
My client wants to have a PDF on which appears the ICC profile selected in the UI PDF Export dialog box from Indesign.
I am thinking about using the onEvent feature but not sure it can help. If I choose afterExport, the PDF will be generated but I wont' have placed the info yet. If I choose beforeExport, I won't know the profile the client wants to use on export :-(
The only safe way I see is to rebuild a full PDF export dialog box. Hence, i can catch the profile info, place it on the doc and finally launche the PDF generation.
Am I wrong to think so ?
Thanks for your advices.
Loic

Hi and thanks a lot for your input,
It worked.
It seems that the script didn't like I ask it to retrace the path to the desktop by itself. But if I convert the path info to a string it's ok.
This works :
app.activeDocument.exportFile(ExportFormat.JPG, (new File('~/Desktop/test.jpg')), false)
This too :
var myFilePath = String(Folder.desktop + '/test.jpg');
app.activeDocument.exportFile(ExportFormat.JPG, (new File(myFilePath )), false)
But that fails
app.activeDocument.exportFile(ExportFormat.JPG, (new File(Folder.desktop + '/test.jpg')), false)
Thanks a lot for your answer.
Loic

Similar Messages

  • 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.

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • 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.

  • Exporting Each question to LMS

    Hello,
    Is there a way that we can export each question within a
    captivate presentation to a LMS system. I do know that we can
    export the results pass/fail etc.. Our issue is that we can't view
    the errors in the questions or be able to review the problems with
    our learners. Any help would be great
    Thank you
    Sergio

    You can set Captivate to report Interactions and Score instead of just Score.
    But whether you can dig down in the LMS reporting to find out how many users chose a particular answer depends entirely on the capabilities of your LMS.  So allow it, most don't.  You might need to get a special report created for your LMS that queries the database and digs out such info.

  • Scripting Question - Very Basic

    Hello, I'm using the trial version of InDesign and am wondering if because it's the trial version that I can't load custom scripts from Adobe?  I've downloaded and installed a Custom Calendar script [I can see the extracted files in/on my PC] but the app apparently doesn't see it.  Any help you can offer is greatly appreciated.  Thanks, 

    Thank you so much, you were spot on. 
    From: Peter Spier <[email protected]>
    To: Friar5 <[email protected]>
    Sent: Monday, December 12, 2011 3:18 PM
    Subject: Scripting Question - Very Basic
    Re: Scripting Question - Very Basic created by Peter Spier in InDesign - View the full discussion
    Have you put thew script in a location that InDesign uses for scripts? See How to install scripts in InDesign | InDesignSecrets
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4079869#4079869
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4079869#4079869. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • 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.

  • Export file questions - wwv_flow_api.set_version?

    Not that I've noticed any problems, but I'm confused by this entry in my export scripts.
    I exported from our Development instance and the file says:
    wwv_flow_api.set_version(p_version_yyyy_mm_dd=>'2007.01.08');
    Then I imported that to our Pre-Production instance, changed the app name to the production name and excluded the Development Only build options. Then I exported that and noticed the file says:
    wwv_flow_api.set_version(p_version_yyyy_mm_dd=>'2007.05.25');
    I checked and both database instances say they're running Apex 3.1.1.00.09.
    Should I care?
    Also, I've noticed (and posted here) that my interactive reports lose their button template setting for the Search box. I looked through the code and found that this setting for each of them:
    p_button_template =>'26790245845863168',
    If I search for all references to that number, I saw the following in my application definition:
    p_default_button_template => 26790245845863168 + wwv_flow_api.g_id_offset,
    And all the other references to that value are like:
    ... => 'template:'||to_char(26790245845863168 + wwv_flow_api.g_id_offset),
    So I replaced the p_default_button_template string with:
    to_char(26790245845863168 + wwv_flow_api.g_id_offset)
    for each of the 3 Interactive Reports, then imported the file and it worked.
    Finally I searched for the definition of wwv_flow_api.g_id_offset and was surprised to find that it's set to 0 in the beginning of the script.
    So I'm still clueless as to why the button template setting gets lost on import.
    Any thoughts?
    Thanks,
    Stew

    Scott,
    Thanks for the speedy and helpful answers.
    It's great to hear that the bug with the button template is fixed in 3.2. You think they'll be releasing a 3.2.1 soon, so I can convince our cautious DBAs to upgrade? I've got enough history in the business to know you don't go with a major release (e.g. 3.0) right away. So I get their caution, somewhat, even though I don't like it sometimes! :-)
    Thanks again,
    Stew

  • Quick script question

    Hi all,
    Could anyone advise me if i can add anything within - header('Location: http://www.mysite.co.uk/thankyou.html'); in the script below so as the page
    re- directs back to the main index page after a few seconds ?
    Thankyou for any help.
    <?php
    $to = '[email protected]';
    $subject = 'Feedback form results';
    // prepare the message body
    $message = '' . $_POST['Name'] . "\n";
    $message .= '' . $_POST['E-mail'] . "\n";
    $message .= '' . $_POST['Phone'] . "\n";
    $message .= '' . $_POST['Message'];
    // send the email
    mail($to, $subject, $message, null, '');
    header('Location: http://www.mysite.co.uk/thankyou.html');
    ?>

    andy7719 wrote:
    Mr powers gave me that script so im rather confused at this point in time
    I don't think I "gave" you that script. I might have corrected a problem with it, but I certainly didn't write the original script.
    What you're using is far from perfect, but to suggest it would lay you open to MySQL injection attacks is ludicrous. For you to be prone to MySQL injection, you would need to be entering the data into a MySQL database, not sending it by email.
    There is a malicious attack known as email header injection, which is a serious problem with many PHP email processing scripts. However, to be prone to email header injection, you would need to use the fourth argument of mail() to insert form data into the email headers. Since your fourth argument is null, that danger doesn't exist.
    One thing that might be worth doing is checking that the email address doesn't contain a lot of illegal characters, because that's a common feature of header injection attacks. This is how I would tidy up your script:
    <?php
    $suspect = '/Content-Type:|Bcc:|Cc:/i';
    // send the message only if the E-mail field looks clean
    if (preg_match($suspect, $_POST['E-mail'])) {
      header('Location: http://www.example.com/sorry.html');
      exit;
    } else {
      $to = '[email protected]';
      $subject = 'Feedback form results';
      // prepare the message body
      $message = 'Name: ' . $_POST['Name'] . "\n";
      $message .= 'E-mail: ' . $_POST['E-mail'] . "\n";
      $message .= 'Phone: ' . $_POST['Phone'] . "\n";
      $message .= 'Message: ' . $_POST['Message'];
      // send the email
      mail($to, $subject, $message);
      header('Location: http://www.example.com/thankyou.html');
      exit;
    ?>
    Create a new page called sorry.html, with a message along the lines of "Sorry, there was an error sending your message". Don't put anything about illegal attacks. Just be neutral.
    By the way, when posting questions here, don't use meaningless subject lines, such as "Quick script question". If you're posting here, it's almost certain to be a question about a script. It doesn't matter whether it's quick. Use the subject line to tell people what it's about.

  • Unique Script Questions-timed startup?

    Hello All,
    I am long time mac fanatic with some unusual script questions. I have a project ongoing where I will need to put my pb 15" in a remote location with a Canon camera. Canon has transmitter device which will allow me via ethernet to ftp to my pb.
    Here's essentially what I need to the script to do and I am trying to find out just how feasible this is. I need my laptop to bootup to receive photos via ftp at a certain time period. The camera will send to the builtin ftp software. Once booted I need the script to hold for period of about an hour. Once time has elapsed I need the script to connect to the internet via a broadband EVDO card. We are using one of the EVDO cards built in to Tiger. It then must ftp a folder of images to a remote server.
    Simple, huh? : ) I am running Transmit as my ftp software. I believe it is scriptable and will watch a folder to send.
    Any ideas? I'd love to hear them. I can be reached via scott at scottaudette.com.
    This setup is going be used in very cool photo location but I can't publicly announce where.
    Scott
    G5 and PB 15"   Mac OS X (10.4.7)  

    'Transmit ... I believe it is scriptable' - yes it is. Go to How can I use AppleScript with Transmit? to download sample 'Transmit' scripts.
    'Once booted I need the script to hold for period of about an hour.' - well then, save the script as a 'stay open' application, with an 'on idle () ... end idle' handler - with a return of (60 * 60) seconds; and then drag the saved application onto the 'System Preferences' 'Accounts' 'Login Items' tab's list - of the user which the Mac will boot to (when turned ON).
      Mac OS X (10.4.4)  

  • Can I post here(Acrobat Windows) Java Script questions here?

    Hello
    Can I post here(Acrobat Windows) Java Script questions here? If not, wht is the correct forum?
    THank you

    Back up and down to Acrobat Scripting. Bot Windows and MacIntosh Acrobat versions use the same JavaScript.
    If you are using LIVECYCLE DESIGNER use their forums. The JavaScript syntax and objects are different in LIVECYCLE DESIGNER!

  • 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

  • Scripting question: how to suppress Aperture dialog when exporting?

    Hi Forum,
    I started to write an AppleScript for Aperture to perform a backup. The standard backup procedures of Aperture are not quite right for me so I decided to write my own using AppleScript.
    One question which arised was how I can supppress the dialog box which Aperture opens when an export could not be done because of a missing master. I want to suppress the dialog box and instead get an error returned from Aperture into AppleScript. is that possible?
    Koen van Dijken

    Hello Koen,
    have you solved your problem by now? For me the following does work:
    I does not seem to be possible to set Aperture to suppress the warning, so catching the error in a "try" clause will not help. The best option is to check, if the master image is online, before trying to export and skipping the offline images, like in this example,  see: http:/dreschler-fischer.de/scripts/ExportMastersWithoutWarning.scpt.zip
    on run {}
      -- export masters, but check it they are online before trying to export
      -- skip if not online
              set exportFolder to (choose folder with prompt "Choose an export folder")
              tell application "Aperture"
                        set imageSel to (get selection)
                        if imageSel is {} then
                                  error "Please select an image."
                        else
                                  repeat with i from 1 to count of imageSel
                                            try
                                                      set onlne to get online of (item i of imageSel)
                                                      if onlne then export {item i of imageSel} naming folders with folder naming policy ¬
                                                                "Project Name" to exportFolder
                                            end try
                                  end repeat
                                  return imageSel
                        end if
              end tell
    end run
    Regards
    Léonie

Maybe you are looking for

  • Urgent.... Help Needed for Storing file in Application Server

    Hi All, I have a requirement where in I have to save a file in Application Server. File is of 141 Character Length, so there can be spaces left at the end. When I am downloading the file into Application Sever and then downloading the same file from

  • Messages gettin stuck at outbound side..

    hi.. my files r gettin picked up successfully. i need to corelate them, i knw corelation is fine. they r suppose to enter the BPM. but they r not. at the outbound side its constantly showin "messages scheduled for outbound side (green flag). my queue

  • IN SL can't get chime to play thru external speakers

    In 10.5 all my computer's sounds were set to be played thru external speakers. Now I can't get the startup chime to do it as it only plays thru the INTERNAL. Any reason? rd

  • I look for guider in signing jars

    Hi everybody for what signing jars is good,for applet jars or desktop applications jars??? and how can I use it? please i need the answerer explanations not url to tutorials Thanks to every reader to this topic

  • Where can i download the previous version?

    downloaded the latest, but some add ons are not available yet. I already deleted the old version. Where can go to download one?