Set up TagUI-Python on Mac - with Visual Automation

Step 1. Check if you have Java installed

  1. First, make sure that you have setup TagUI-Pypthon on your Mac, as outlined in the article: Setup TagUI-Python on Mac.
  2. TagUI visual automation requires Java libraries. Let's do a check to see if you have Java installed on your machine. In the Terminal window, type the following command:
  3. java -version

  4. If you see the screen below, then you have Java installed on your machine. Please proceed to Step 3. Setup TagUI - Visual Automation.

Step 2. Install JDK

  1. Install Homebrew on your Mac if you haven’t.
  2. Run the following command. This is to add more repositories to brew.
  3. brew tap AdoptOpenJDK/openjdk

  4. Install the OpenJDK 8 with the following command:
  5. brew cask install adoptopenjdk8

  6. Now re-run java -version to see if you get the following:

3. Setup TagUI with Visual Automation

  1. Start python3 in a Terminal. Once you are in Python, type the following:
  2. import tagui as t
    t.init(visual_automation = True, chrome_browser = False)

  3. If everything runs ok, you will see a True displayed as shown below.
  4. If this is the first time you run visual automation, most likely you will see the following warning message. This is ok, as long as you see True displayed. If not, press Ctrl+D to exit the Python Interpreter and repeat Step 8.
  5. When you start to run Visual Automation codes, you might also see the following warning message.
  6. Click the Open System Preferences button. You will see the following:

    Click the Click the lock to make changes icon at the bottom left. Once you have keyed in your password, the items on the right will be unlocked as follows. Make sure you check the one for Java.

    You can click that lock again to prevent further changes.

4. Test TagUI with Visual Automation

  1. Copy the following 4 lines and paste them direct into the Python interpreter:
  2. t.keyboard('[cmd][space]')
    t.keyboard('safari[enter]')
    t.keyboard('[cmd]t')
    t.keyboard('google weather singapore[enter]')
    
    

    Note: Copy and paste ALL the 4 lines together, and not one by one. This is because right after the Cmd+Space is pressed, you want the bot to enter safari direct into the search field. If you copy one by one, you will see safari entered in your Python window, which is not what you want. Your command prompt should look like this:

  3. If everything runs ok, the bot will press Cmd+Space, launch Safari and enter the text google weather singapore. You should get the results similar to the web page below:

Congratulations! You have successfully setup Visual Automation in TagUI!

Comments (0)

There are no comments posted here yet

Leave your comments

Posting comment as a guest. Sign up or login to your account.
Attachments (0 / 3)
Share Your Location