I want task scheduler to run a job every day, every one hour, but not run on specific days, at specific hours

Problem:

I want to schedule a job to run every day, every one hour, but not run on specific days, at specific hours via the task scheduler.

Solution:

We add a Recurring Trigger that will run every one hour, and then within our job, we enter the following actions to specify during which hours of which days we do not want our job to run.

Discussion:

In our example we have specified that we do not want our job to run during weekends from 09.00 till 17.00, so if the day of the week starts with an “S” (Saturday, Sunday), then it should then check what the current time is and according to the result it should either continue with the job’s flow or end the job successfully if the current time is appropriate for the job to run.

I want to get a random line of a list

Problem:

I want to get a random line of a list

Solution:

We need to read the list, and use the Count property of our List to define the number of the lines contained in our list, in order to generate a random number within the defined region.

Discussion:

We use the “Read Text from File” action to specify the list we want to parse data and get the random line from. It is important to specify that we want to store the content as a List. We then use the “Generate Random Number” action to populate any random number within a region starting from 0 till the total number of the lines on our list.

I want to make sure that the user input is always a number.

Problem:

I want to make sure that the user input is always a number

Solution:

We simply convert the User’s Input, into a number, and add an exception to the event that the provided text cannot be converted into a valid number.

Discussion:

Using the “Display Input Dialog” action, We simply ask the user to type in a value. That value we then convert it to a numeric value using the “Convert Text to Number” action. If the value cannot be converted, that means that the user’s input is not a number. In the “Convert Text to Number” action we add an exception handling to perform some other actions in the event this error occurs.

I want to define my job’s flow according to the user’s input

UI automation

Problem:

I want to define my job’s flow according to the user’s input

Solution:

A general pattern used to define the flow of a job according to the user’s input can be found in the following job.

Discussion:

We use a “Display Input Dialog” action to retrieve some information from the user. In our example, it is obvious that there’s only one answer to the question made to the user. So, we can determine the flow of our job according to the user’s input.

When an Input Dialog appears, the user has two options. Either press ok or Cancel.

Retrieve specific item from a list

When you use automation software like WinAutomation, you eventually come across lists. A text file can be stored as list, the files that you retrieve from a folder are stored in a list, the cells of an excel row are stored in a list. Sometimes, you will need to use a specific item of a list that is saved in a variable (e.g. the first item, the last item, the 9th item etc). In order to retrieve a specific item of a list, you will have to use the following notation: %VariableName[ItemNumber]%. Keep in mind that the “ItemNumber” should be 0 for the first item of the list, 1 for the second and so on.…

Copyright 2017 - Softomotive Ltd