How to create a button switches with Automator

Greetings,

I want to create an executable if/then script Automator or Apple Scripts. I have minimal experience with Apple Scripts, so I don't know if this is even possible. The script to check if a particular folder has no content and depending on the outcome, I need to run one of the two Automator scripts that I created.

If possible, I'd like to have a toggle instead, simply switch off between my two Automator scripts.

Any help is very appreciated.

Here are the basic flow to test whether a specified folder is empty or not. He calls automator once with the appropriate workflow.

property folder_to_check: ((path to the Office) as text) & "Test:" as alias

property workflow_for_items: ((path to the folder) as text) & "folder_has_items.workflow".

property workflow_for_noitems: ((path to the folder) as text) & "folder_has_noitems.workflow".

game of qtdworkflow to «»

say application 'Finder '.

if elements of folder_to_check is {} then

form of city of the trajectory of the value qtdworkflow to POSIX workflow_for_noitems

on the other

form of city of the trajectory of the value qtdworkflow to POSIX workflow_for_items

end if

end say

qtdworkflow & worth theResult for shell script "automator."

return

Tags: Mac OS & System Software

Similar Questions

  • How to create a button with rollover that appears in a different place than the button when you move?

    Hello

    How to create a button with rollover that appears in a different place than the button when you move by using only the Muse (reversal may be a different shape and color of the button). I managed to do it using Photoshop and the separate layers and import it, but it is not a good solution. All suggestions will be welcome.

    Thank you

    You can try to use the widget of the Composition of the ToolTip. In this way, the trigger area is isolated and a "State of reversal" can be placed anywhere on the screen (compared to the trigger).

    • Remove the two triggers additional default
    • Set to display the targets on working capital
    • Select hide all initially.
  • How to create a button like the one pictured here

    How to create a button in the button "print" below?

    I was actually thinking of doing it two separate buttons placed side by side. The "print" button, of course would be just updated the Boolean value, that is easy. But the drop down menu is a bit more difficult. I tell myself that I could customize a drop down, but because I was not able to play with it in LabVIEW (don't have it at home) I don't know if you can change the alignment of the drop-down box actually etc. The decline is down to the location of the box and look like something you can change in the control editor?

    I guess I could also use correct .net? But I'll try to keep it all with just control editing in LabVIEW if possible. Thank you.

    for (imstuck).

    I use a listbox multicolumn and toggle visibility is when the user clicks the button.  I've attached an example:

    ~ Simon

  • How to create a recovery disc with all vista updates?

    original title: how to create a recovery disc with all vista updates without starting from scratch, so I can replace my hard drive?

    My hard drive seems to be dying.  I would replace the drive.  I reloaded vista from scratch with all the updates, but it took forever.  I would like to make a record of recovery with all updates.  IAM on vista Home premium.  32 bit

    If you want a good backup program that backups image, I recommend Acronis True Image 2010:http://www.acronis.com/homecomputing/products/trueimage/.  It offers a free trial, so you can test and if you want it's only about $30 for the original version.  A lot of people I know this program and use it instead of Vista even in versions of Vista that offers imagery as this program does a better job.  Of course you also need a place to put the backup (which will take a lot of space), so also consider.  The best choice would be a USB external hard drive at least as large as the readers you want to back up (not only the data on them, but the entire available disk space, so you miss when you add more information about the disks).

    You cannot use IMGBURN do - it can't do anything like that.  It must be the imagery of backup software.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to create a button icon / browse files

    Hi all, I have 2 questions I want to ask you:

    1. how to create a button icon using action script?

    I add this part of the code at the top of my file .as just below the keyword package:

    [Bindable]
    [Embed(source="/images/pause.png")]
    private var pauseIcon: Class;

    I then added, in the main function, copy the following code:
    var pauseButton:Button = new Button();
    pauseButton.setStyle ("icon", pauseIcon);

    The compiler problem with the "private var pauseIcon: Class; ' line and the new line of declaration of button.  I declare the type of button?

    2. how to browse files in the Simulator? I try to use browseForOpen, but it does not work.  It shows a blank dialog box saying no file meets my criteria.

    My code for browsing the files:

    var docFilter:FileFilter = new FileFilter ("Files", "*.") *") ;

    var myFile = File.applicationStorageDirectory;

    myFile.browseForOpen ("Open", [docFilter]);

    Thank you

    The embedded definition must be within the class as a normal attribute / member of this class.  You have outside the classroom.

    [SWF...

    SerializableAttribute public class Main extends Sprite

    {

    [Embed(source="/image/player_pause.png")] private var pauseIcon: Class;

    public void Main()

    {

    var btn: IconButton = new IconButton();

    btn.setIcon (new pauseIcon());

    this.addChild (btn);

    }

    }

  • How to create a new project with other page with the new version of Muse layouts?

    Hello
    If someone would continue to operate as before with the inadmissible Muse version... is - this posible to have both versions installed? or how to create a new project with other page with the new version of Muse layouts?
    Or how to download third party) 3 different configurations (desktop/tablet/mobile) under the same url with a clean result, like up yet with the Muse does not?

    Thanks for any help,

    Patrick

    Use the new version! What you want to achieve, will work! Go to the 'Page' menu and choose 'Add another Layout' and the missed buttons are in plan view.

  • How to create a button 'Click me' on a pop up image?

    How to create a button 'Click me' on a pop up image?

    It does not work like that.

    Links are created with HTML code.

    They must be inside an HTML document.

    Put your image and links within a new upploadare

    Link your local script to the HTML file and not the image file.

    Although personally, I'd use a modal window instead of these old pop-ups.

    Nancy O.

  • How to create a button to download files in the form?

    How to create a button to download files in the form?

    Hello

    Please refer to the link below with a similar discussion.

    Download file button

    Kind regards

    Vivek

  • How to create a button that is persistent on the top of the Gallery HTML page

    Hello

    My InDesign folio, I have an article with photo gallery full HTML page. The photo grid occupies the full screen. I want to create a button that is persistent on top of this gallery, which the user can type to go to the main Menu page. This button is always visible in one place, even as the user scrolls up and down the gallery. I tried to create it on the top layer and the upper layer of the page master, but the button disapperas loading the HTML gallery.
    If the user does not see any button to navigate through the Gallery to another article.

    Any ideas how to create persistent button?

    Thanks in advance.

    -MP

    Why not do things just like an HTML article? You do it in the Muse.

  • How to create the new domain with lookup?

    How to create the new domain with list of choices like terrain dDocType system?

    Administration/Admin Applets tab / SCCM / information fields.
    Add field or edit a custom field if you have one.
    The name field (the name will be prefaced with the lowercase letter x behind the scenes, if ever, you write the code to call it if you name this Fruit it will xFruit for code)
    Define your values for the field, but the important thing for a menu drop-down list or list of selection will be to list the Option activate the checkbox.
    Then, you perform one of the 3 main things to put data in the list.
    1. manually fill in a list of options
    2. use a DB or DB table view to view Configuration Manager
    3. create a complex tree (read the documentation on which I him have not used)

    If this does not answer your questions, click the help button in the applet.

  • How to create a photo album with ms office?

    How to create a photo album with ms office? I tried to use picasa, but I don't know how to make an album. I also want to add a text below.

    Click on the Forums link at the top of the page and go on the forums of office to ask. But, if you can not understand Picasa, you'll probably some luck using nothing else. Consider going on the forums of Picasa and get help.

  • How to create a button that opens the attachment (file power point attached to the pdf document)

    Hello world!

    The question is in the title.

    How to create a button in Acrobat Pro to open a file attached to PDF?

    I have moved your question to one of the forums of Acrobat, first.

    If the target file is not a PDF file you need to use a script to do it. The structure of the script would be something like this:

    this.exportDataObject ({cName: "Name of the attachment.ppt file", nLaunch: 2});

  • I need to update the screenshots for a new version of an app existing Itune application to download a new version. Since I did not create the original version, can you guide me how to create a new version with the new version number?

    I need to update the screenshots for a new version of an existing iTunes Connect App asks me to download a new version. Since I did not create the original version, can you guide me how to create a new version with the new version number?

    You must call the assistance of the company and ask them to help you with this. You can find contact information by logging on http://digitalpublishing.acrobat.com/ and looking at the Middle at the bottom of the page.

    Neil

  • How to create a menu manual, WITH dropdowns

    How to create a menu manual, WITH dropdowns

    You can use the "Composition" widget with these settings:

    Note: Use triggers to place your text. You can use each box to add all your links on the page in question.

  • How to create a button in AS3?

    Hello everyone

    How to create a button in the action script 3 and handle the click event?

    Thank you

    Maybe this will help you get started.

    import flash.display.Sprite;

    import flash.events.Event;

    import flash.display.Graphics;

    var button: Sprite = new Sprite();  Sprite to act as the image of the button.

    Set the color of the button image

    button.graphics.beginFill (0xFFCC00);

    The value of X, Y, width and height of the button image

    button.graphics.drawRect (10, 10, 200, 60);

    button.graphics.endFill (); Apply the fill

    this.addChild (button);  Add button Sprite to the stadium

    button.useHandCursor = true;

    button.buttonMode = true;

    button.mouseChildren = false;

    button.addEventListener (MouseEvent.CLICK, buttonClickHandler);

    function buttonClickHandler

    {

    trace ("button clicked!");

    }

Maybe you are looking for