Alert message before exporting PDF

Home Forums InDesign Add-ons (Scripts, Scripting, and Plug-ins) Alert message before exporting PDF

This topic contains 8 replies, has 3 voices, and was last updated by  Masood Ahmad 6 months, 1 week ago.

  • Author
    Posts
  • #91193

    Masood Ahmad
    Member

    Hello Everyone,

    A very Happy New Year to you all :)

    Is it possible to have an Alert Message (with OK and Cancel buttons) when the user exports a PDF either by cmd+E or by File>Export option.

    The message can be like this:

    Have you check the file thoroughly before exporting the PDF?

    OK Cancel

    Clicking on the Cancel button will cancel the export.
    OK button will export the PDF

    JavaScript is preferable. AppleScript can also work.

    Thanks in advance.

    Masood Ahmad

  • #91229

    Masood Ahmad
    Member

    Did I asked too much or is this impossible to achieve??

  • #91235

    David Blatner
    Keymaster

    It’s a good idea, but I don’t know any way to make InDesign do that. Maybe with APID from Rorohiko?

  • #91241

    Masood Ahmad
    Member

    I too have the same thought but I’m sure people like Peter, Keith or Jongware can do that.

    It’s a big challenge…

  • #91244

    Try this one and put it in a start up folder. The alert will only have a yes and no. Maybe ok and cancel is possible with script-ui.

    #targetengine "doSomethingInCase"
    
    app.addEventListener("beforeExport", onExport);
    
    function onExport(event) { 
      var result = confirm("Have you check the file thoroughly before exporting the PDF?", true, "WARNING");
    
      if (result == true) {
        return
      };
      else (result == false) {
        event.stopPropagation();
        event.preventDefault();  
      };
      return;
    }
    

    Kai

    • #91261

      Masood Ahmad
      Member

      Hi Kai,

      Hope you’re well and had a great weekend.

      Being a non-programmer, I’m trying to learn “JavaScript for InDesign” from a very long time. I have searched the web but didn’t get anything that can teach me the same. I have also gone through the course “InDesign-Scripting-Made-Easy” by Keith on Lynda, but fails to understand it. I then took a course in JavaScript, HTML and CSS from a reputed Institute. There I learned about the Web and the basics of JS. The instructors over there were unaware about the InDesign DOM and hence I’m left with no knowledge about the course I’m looking for.

      The Keith’s course gives the basic idea about the DOM but not in depth. For example, how to read DOM, how to capture the commands and options from DOM and utilize them in the JS. There is a huge .chm version of the DOM by Jongware, I have downloaded it but unable to read/understand it.

      Can you please guide me and recommend something in this regard. Meanwhile, I’m trying to get in touch with some Programmers, who are working on InDesign JavaScript.

      Thanks in advance,

      Masood

    • #91262

      Hi Masood,

      there exists always two kind of people: Graphic designers and scripters. Unfortunately most books and courses are written by scripters. So sometimes very dry stuff and hard to understand. I’m a graphic designer. So if I have problems, I have problems with JS and not the DOM ;-)

      To get a good start, I can recommend Peter Kahrels guide: http://shop.oreilly.com/product/9780596802530.do
      Allthough this isn’t up to date, it covers all important parts.

      Then Grant Gamble: https://www.amazon.de/InDesign-CS5-Automation-Using-JavaScript/dp/1460915380

      And at least: The Javascript course at lynda.com from Simon Allardice

      Notice one big thing:
      You cannot read those books from start to finish. There will always be a situation, where your script goes wrong or you do not understand what the author is tryin’ to say you. This time, the indesignsecrets or adobe-scripting forum is your friend, where you can post your code and people will give you in short an answer.

      hth
      kai

    • #91267

      Masood Ahmad
      Member

      Thanks Kai, for your suggestions. I’ll go through these and hope to have a good start.

  • #91245

    Masood Ahmad
    Member

    Million thanks for a quick solution. This is exactly I was looking for.

    It’s good to have so much talented people in this community.

    Once again many thanks.

You must be logged in to reply to this topic.