How to insert If / then into my process

Discussion in 'Automator' started by Shandit66, Nov 27, 2017.

  1. Shandit66

    Shandit66 New Member

    Joined:
    Nov 27, 2017
    Messages:
    1
    Likes Received:
    0
    Sorry, I am a newbie to Automator and have searched around for solutions, but there's something I'm conceptually not understanding.

    What I'm trying to do:
    1 - I have Excel cranking out reports, daily, and saving a PDF to a folder
    2 - I created and Automator workflow, that is supposed to email this report out.

    This currently works as desired

    But...

    If the file is not there, it should not send an email, that day.

    What I've done:

    A - Finder Finder Items
    Search = <my folder>
    If All of of the following are true
    Name contain <my file name>
    Date created = is today
    Kind is PDF

    B - Get Folder Items
    If it finds the file, the log shows me:
    "Find Folder Items completed" and
    "Get Folder Contents completed"

    But if it doesnt find the file, I get
    "Get Folder Contents completed - 1 warning"

    At that point I want to stop all further actions


    It seems like I need to insert an Apple script to determine is a file was found.
    If yes, continue
    If no, quit

    How do I proceed?
    Thanks for your help
     
    Last edited: Nov 27, 2017
    Shandit66, Nov 27, 2017
    #1
    1. Advertisements

  2. Shandit66

    Cory Cooper Moderator

    Joined:
    May 19, 2004
    Messages:
    5,276
    Likes Received:
    158
    Hello and welcome.

    I am not very experienced with Automator and AppleScript. Maybe the folks over at MacScripter could lend some direction.

    C
     
    Cory Cooper, Dec 25, 2017
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.