Automator for PDF merge with variable

Hi - very new to automator, but now very motivated to find a solution to this annoying problem.
I have to scan expense receipts each week and upload them 1 by 1 into a client time & expense system. I don't think Automator can help me with this one.
A second system requires all the expense receipts to be merged into a PDF and a 3rd copy emailed to an approver.
This is what I would like automator to do:
From my Expenses folder, where all my individual PDF's are located
I select all my distinct PDF's for a particular week
Using an automator service, right click style
Using 'Ask for Text', I would enter the "Week of"
My selected PDF's are merged into 1 PDF, with the name = "Week of <VAR>"
Mail starts (can't figure out how to use Gmail in a browser in Automator)
Creates a message to the approver guy with the merged attachment from #5 above
Sends the message
Quits Mail
I can get the automator to run without the variables trick...but it really would save a lot of time if I could just key it in once (instead of #filename, #email subject, #body of the message).
I also tried looking up the UUID for the variable and inserting it into the email body and subject line - but it didn't take.
Can anyone help with this?
Many thanks
bforeste

Can't help you with automator, but you can create an app with the applescript below that will do what you want.
Procedure:
1. Open the Applescript Editor by typing Apples in the spotlight search field and hitting 'return' on your keyboard.
2. Copy the entire script below and paste it into the Editor window.
3. Hit 'Command-K' on the keyboard and ensure there are no compiler errors. If there are, please look at the script and see if one part of it was highlighted. Report back what part of the script was highlighted and any error messages.
If the compile didn't produce an error, then:
4. Hit 'Command-S' on the keyboard, choose a snazzy name ("PDF merger" or something...) and a location to save it in (your Apps or Desktop folders).  Be sure to change the 'File Format:' to Application at the bottom of the Save screen before hitting 'Save'.
5. The first time you run the app (you run it by double-clicking on it, like any other App), you'll be asked to put in the details manually. On subsequent runs, it will fill in the defaults for you. I haven't set up the default locations for looking and searching for the files as I'm not sure where they would be on your system. I can do that if you tell me the path from your 'home' or user directory.
Also note, I've written the script so that it doesn't send the message until you've reviewed it. i.e., you might want to double check you've attached the correct file, or add a message. If you want it to send automatically without review change the following lines near the end of the script:
change the line 'set visible to true' to 'set visible to false'
change the line 'save' to 'send'
property defaultFolder : ""
property msgSubject : ""
property theRecipient : ""
property theWeeklyname : ""
property outputFile : ""
getInfo()
mergePDFS()
sendMail()
on getInfo()
          display dialog "Type the recipient's email address: " default answer theRecipient
          set theRecipient to the text returned of the result
          delay 0.25
          display dialog "Set the subject of the message: " default answer msgSubject
          set msgSubject to the text returned of the result
end getInfo
on mergePDFS()
          display dialog "Please choose the files to merge…" default button "OK"
          set inputFiles to choose file of type "PDF" with multiple selections allowed without invisibles
          delay 0.25
          display dialog "Please choose a folder to save the merged PDF…" default button "OK"
          set outputFolder to choose folder
          delay 0.25
          display dialog "Type the name of the combined pdf (without the .pdf extension): " default answer theWeeklyname
          set theWeeklyname to text returned of the result
          set outputFile to (outputFolder as text) & theWeeklyname & "(" & (count of inputFiles) & ").pdf"
          set pdfFiles to ""
          repeat with p in inputFiles
                    set pdfFiles to pdfFiles & " " & quoted form of POSIX path of p
          end repeat
          do shell script "/System/Library/Automator/Combine\\ PDF\\ Pages.action/Contents/Resources/join.py " & "-o " & quoted form of POSIX path of outputFile & pdfFiles
          return outputFile as alias
end mergePDFS
on sendMail()
          tell application "Finder"
                    set theAttachment to outputFile as alias
          end tell
          tell application "Mail"
                    set newMessage to make new outgoing message with properties {subject:msgSubject, content:"" & return & return}
                    tell newMessage
                              set visible to true
  make new to recipient at end of to recipients with properties {address:theRecipient}
                              tell content
  make new attachment with properties {file name:theAttachment} at after the last paragraph
                              end tell
  save
                    end tell
          end tell
end sendMail

Similar Messages

  • How do I create an interactive PDF file with variable data

    We would like to basically do a 'mail merge' of our list of customers with an interactive PDF file (including videos, menus, etc - not just form fill out and web links) to create a single PDF file that contains multiple mail pieces ... one for each customer ... with each mail piece being customized for that customer.  Customizations would include different greetings (Dear Bob, Dear Dana, etc), as well as different charts based on data unique to the customer, different photographs, etc.
    I've seen that InDesign and Acrobat Professional can be used to create an interactive PDF (such as from http://tv.adobe.com/watch/ask-the-adobe-ones/14-calling-rufus-about-interactive-pdf-making).  However I don't understand how I can insert data from a database, csv file, excel file etc into the PDF file so that each page, or each set of pages, within the PDF can be customized.
    Can anyone point me to a tool to use for this?
    Thanks,
    Bob Kendall

    For that kind of volume and unattended operation, you want InDesign Server – which is the server/high volume edition of INDD.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Thu, 3 Nov 2011 06:58:07 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: How do I create an interactive PDF file with variable data
    Re: How do I create an interactive PDF file with variable data
    created by Ti26E31DSxxx<http://forums.adobe.com/people/Ti26E31DSxxx> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4005459#4005459

  • Tip for Data Merge with Multiple Records (labels, etc.)

    I have seen many InDesign Data Merge questions about how to create sheets of mailing labels, especially the problem of getting only one label per page, when you need 30 or more.
    Adobe's instructions are poor and incomplete in that InDesign doesn't step out the records from a data source - it steps out the FRAMES that contain the data field placeholders.
    That is why you only need to place a text or image frame once on a single page - during the datamerge, InDesign will create the additional FRAMES for each record, and it will create the pages required to hold them.
    You do have to set the desired spacing on the
    If you create the frame on a Master page, ID allows you to update the data source (when it changes) in the Data Merge tool panel.
    These are very nice and robust features, but the documentation for them is confusing to many people.
    You will find more great in-depth help  for Data Merge, with screen captures and attachments, here in the forum.

    For a multiple record merge you need one set of placeholders, then set the margins and spacing in the merge options so the positioning is correct.
    Warning: Using Preview in a multiple record merge will corrupt the file. If you press the preview button, Undo after looking at the preview, then merge without using preview.

  • In Design Data merge into separate pdf files with variable data name

    Hi all, thank you for taking the time to read this.
    Here's what I have.
    I've created a file in indesign using a 65 page document.
    With this document I've set it up to have specific data in certain areas with data merge.  I have that part setup and it works fine. 
    When I go to export PDF it creates one massive pdf document with all the variable data in it.  However here is the scenario I would like.
    1. Indesign to create a separate pdf file for each record.  So in this example it would be 100 different 65 page pdfs since it should have different pdfs for each record and there are 100 records in the csv.
    2. The pdf should be named after each variable record.  For example record one says name "Joe", record 2 name "Frank".  So it should create joe.pdf, frank.pdf etc.
    How can I accomplish this?

    I don't know if this script works in CS4 or not:
    http://indesignsecrets.com/page-exporter-utility-peu-5-script-updated-for-cs3.php

  • Access restriction for PDF generated with Smartform

    Hi there,
    I am generating a PDF from a Smartform using convert_otf.
    What I would like to do is, add restrictions for the generated document just like in Acrobat Professional.
    For example:
    Printing: yes/no
    saving: yes/no
    cut, copy paste: yes/no
    Is there a way to pass this Parameters to the PDF?
    Thanks in advance
    Uli

    Hello,
    check this thread: Mailing PDF Attachment with Password Protected
    Otto

  • InDesign export to single PDF files with variable Filename

    Hi there,<br /><br />I create a document with Data Merge which contains about 200 Pages. Now i want to export each page to a single PDF-File. Also the filename has to be generated from the placed content. The placed content are adresses. So i want to generate a filename with a static name. I got an ID, a static phrase and then a ZIP-Code. The Filename should look like this: <ID>September<ZIP Code>.pdf while ID and ZIP Code are fields from the datamerge.

    what you need is to operate throuh a loop.<br />for(i=0; i<app.activeDocument.pages.length;i++)<br />{<br /> //Assuming you labelled the textframe containing the ID with ID<br /> var myID = app.activeDocument.pages[i].textFrames.item("ID").contents;<br />//Assuming you labelled the textframe containing the ZIP with ZIP<br /> var myZip = app.activeDocument.pages[i].textFrames.item("ZIP").contents;<br /><br />var myPath = //something like "/disk/folder/" //Set a path to where you want to export the pdf<br />var myFileName = myID + myPath + myZip + ".pdf";<br />//Export to PDF - the forum is full of examples, you should find easily what you are asking for with search<br />} <br /><br />Loic

  • Automated report/ PDF conversion with AppleScript

    Hello-
    I am attempting to PDF a spreadsheet from Dropbox, and email it to a set list of recipients with AppleScript.  Much of this I have been able to figure out, but I am having some issues with the PDF conversion.  As you can see below, I am still working on sending the xls file, and have not yet been able to get AppleScript to convert a specific tab of the file to aPDF.  I expect scheduling to be handled theough crontab.
    Current script is as follows:
    tell application "Finder"
              set folderPath to folder "Macintosh HD:Users:user:Dropbox:folder:Calculated PO Sheet"
              set theFile to first file in folderPath as alias
              set fileName to name of theFile
    end tell
    set theSubject to "Current PO Report" date
    set theBody to "See attached."
    set theAddress to "recipient email"
    set theAttachment to "CALCULATED PO SHEET.xlsx"
    set theSender to "sender email"
    tell application "Mail"
              set theNewMessage to make new outgoing message with properties{subject:theSubject, content:theBody & return & return, visible:true}
              tell theNewMessage
                        set visibile to true
                        set sender to theSender
      make new to recipient at end of to recipients with properties {address:theAddress}
                        try
      make new attachment with properties {file name:theAttachment} at after the last word ofthe last paragraph
                                  set message_attachment to 0
                        on error errmess -- oops
      log errmess -- log the error
                                  set message_attachment to 1
                        end try
                        log "message_attachment = " & message_attachment
      #send
              end tell
    end tell

    Hi,
    there is a special setup for this requirement. Please see the following support note
    Reference
    Oracle Reports Output For Indian Languages Like Gujarati, Marathi [ID 980554.1]
    Roberto

  • Send Invoice as PDF Attachment with variable Filename

    Hello!
    We got a requirement from one customer. We should send our invoices as PDF-Attachment via E-Mail but the attachment must have a variable filename. At the Moment we can send invoice as PDF-Attachment but only with a fix filename.
    How can we change the filename in our Adobe Forms?
    Best Regards
    Markus

    Hi Florian!
    Answer 1:
        The original Name is Druckdaten.pdf
    Answer 2:
         Our entry in NAST-NACHA = 1
    Answer 3:
         I can implement some ABAP-Code
    Here some Screenshots:
    Configuration  of printer E-MAIL:
    Best regards
    Markus

  • Setup reports for pdf creation with company logo and printing without

    Hi,
    we want to have 2 different report-layouts.
    The first one is just for printing on company paper. So it doesn't need a logo.
    The second one is for exporting to PDF file. So it needs a logo.
    How can I realise it in SAP BO 2007 without changing the standard layout everytime?

    Meike,
    If sending out pdf's vs printed doc's depends on BP or user, you can play with setting up the default layout for specific users or BP's, otherwise you need to change the default one all the time.
    Regards,
    Nat

  • AppleScript for mail merge with Excel data?

    Is there any approach for an AppleScript that lets you use Excel data as source for some kind of mail merge operations? If not, would anyone here be interested if someone (I?) would take a closer look at some kind of a (AppleScript Studio) solution for this?

    I'm not sure I get the question.
    If it is "could you use AppleScript to create mail merge for Pages with Excel?", the answer is, Yes. Both Pages and Excel are scriptable.
    If the question is "has anyone done it yet?", I don't know, but it could be a fun exercise.
    If the question is "would there be a market, if someone (you?) wrote and released such a script?", I cannot tell, but personally I would probably write a hack that worked only for my own needs - if I had them. The overhead with usability, testing, different address formats, languages, different Excel sheet formats, and so on, makes me guess that the investment wouldn't pay off for a generic solution. Especially considering both Pages and MS Office already have their own mail merge functions.

  • Question for If condition with variables

    HI Expert, there is a question need your kind help. I am doing the report based on the RTF, and logic is I init the variable 'INCOME' firstly, and then set the value of the varibale in the loop, then I need check this variable by if condition, the logic is simple, but it can not work and the setting value seems cannot be effective in if condition(cannot do print)
    Code list as below:
    <?xdoxslt:set_variable($_XDOCTX,'INCOME', 0)?>
    <?for-each:GLB_ARCH_PR?><?sort:current-group()/GLB_PAY_ARCH_EE_INFO/PERSON_ID;'ascending';data-type='text'?>
    <?for-each-group:GLB_PAY_ARCH_PR_TAX_DEDUCTIONS;./SECONDARY_BASE_CLASS_NAME?>
    <?xdoxslt:set_variable($_XDOCTX,'INCOME', 123)?>
    <?if: xdoxslt:get_variable($_XDOCTX,'INCOME') > 0?>
    .....// print something
    <?end if?>
    <?end for-each?>
    <?end for-each-group?>
    In addtion, the first line is in a cell of table, and other lines(setting variable's value and if condition) in another cell.
    I guess the variable can not be set and then be checked by if in the same loop(or same cell)? If I do set_variable outsides the loop, the logic can work, could you please tell me if my guess is right? and provide some solution for this.
    Thanks a lot!
    Edited by: 859061 on 2011-5-15 下午8:25
    Edited by: 859061 on 2011-5-16 下午7:58

    Thank your feedback in forums for Oracle RTF template questions.
    In fact, I found if the variables value setting and if condition in same cell, the value setting always be not effect before the if condition. So if you want set the value firstly, then do if condition. In this case, you cannot get your logic target.
    So I guess if the variables value setting and variable if condition in same cell, the execution sequence can not be fixed, or if condition always do first than other operation?
    I have done a test to confirm this, I have set the value as 1 for initiation, and if condition is more than 0, so every row can be display. At this case, I modified the value setting as
    <? if: xdoxslt:get_variable($_XDOCTX,'Index') = 3 ?>
    <? xdoxslt:set_variable($_XDOCTX,'INCOME', 0)?>
    <?end if?>
    <? if: xdoxslt:get_variable($_XDOCTX,'Index') != 3 ?>
    <? xdoxslt:set_variable($_XDOCTX,'INCOME', 1)?>
    <?end if?>
    That means the variable should be set as 0 when row 3, and that row should not be displayed, but in fact all rows displayed.
    My target logic just is do value setting by some logic every rows, and then decide show this row or not by the value, what's more, I have to set them in same cell for loop limitation.
    I hope you can find any solutions for this.

  • Forms for pdf opening with sign

    I will need my clients to sign forms from my website http://www.sandiegoelitefitness.com . Can I use any version of adobe reader or does it always have to be the latest version to work or is better just to email forms. thanks j

    Not any version of Reader, but I think at least X or XI.
    Emailing documents always allows for the possibility that the attachments may get damaged or even lost during transmission.

  • OBIEE PDF header with variable

    Hi,
    I am using ver. 10.1.3.4.1. Is it possible to include a column value in the header of the report like @1 in Answers? I tried using a variable reference like @{sldate} in header but no luck. Any possible ideas or solutions.
    Thanks
    Edited by: user7583802 on Jul 22, 2011 7:46 AM

    Yes, this is possible if you use narrative view in the header of the report. Please refer the below link which explains about narrative views and what you can reference in them.
    http://download.oracle.com/docs/cd/E12096_01/books/AnyUser/NarrativeView.html
    Regards,
    -Amith.

  • Interactive PDF file with layer visibility issue.

    I have created an interactive PDF file in InDesign CC and added buttons in Acrobat CC. The buttons reveal layers with the layer visibility action under properties. The problem is that Reader takes 3-4 seconds to show the layer in full screen mode and flickers in any other view.

    For that kind of volume and unattended operation, you want InDesign Server – which is the server/high volume edition of INDD.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Thu, 3 Nov 2011 06:58:07 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: How do I create an interactive PDF file with variable data
    Re: How do I create an interactive PDF file with variable data
    created by Ti26E31DSxxx<http://forums.adobe.com/people/Ti26E31DSxxx> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4005459#4005459

  • PDF forms - underlined variable text

    Hello Everyone,
    I am trying to create a PDF form with variable text fields in Acrobat 9 Pro and I see there are very limited possibilities in the text formatting. I can specify font, size, color, border, but there is missing any option how to switch on the underlining of the text. Is there any way how to achieve this?
    Thanks in advance for any hint.
    Regards,
    Jan

    You can add some JavaScript to your script that imports the data from the database and format the inserted text by using the span object to apply the underline property. The following ecample is from the Acrobat JavaScript API Reference.
    Example
    Write rich text to a rich text field using various properties. See the Field object  
    richValue property for more details and examples.
    var f = this.getField("myRichField");
    // Create an array to hold the Span objects
    var spans = new Array();
    // Each Span object is an object, so we must create one
    spans[0] = new Object();
    spans[0].alignment = "center";
    spans[0].text = "The answer is x";
    spans[1] = new Object();
    spans[1].text = "2/3";
    spans[1].superscript = true;
    spans[2] = new Object();
    spans[2].superscript = false;
    spans[2].text = ". ";
    spans[3] = new Object();
    spans[3].underline = true;
    spans[3].text = "Did you get it right?";
    spans[3].fontStyle = "italic";
    spans[3].textColor = color.red;
    // Now assign our array of Span objects to the field using // field.richValue
    f.richValue = spans;

Maybe you are looking for