X
Icon


Blog Image

Tech Tip: Scheduling Scripts in IDEA V11.1


The Schedule feature, included in IDEA V11.1, lets you configure scripts located in the Macros Library Group (in the Current Project Library) to run on a set schedule. Scripts include IDEAScript macros, Visual Script macros, and Python scripts. Only one schedule can be applied to a script at any given time.

You can even set email notifications to alert you if the schedule script ran successfully or if it failed. After a schedule is set for a script, a clock icon appears beside the script name in the Library window.

Using and Enabling the Schedule Feature

To use the Schedule feature:

  • You must have local administrator privileges on the machine.
  • You must run IDEA as an administrator.
  • The same administrator account must be used to schedule all scripts.
  • The administrator account used to schedule the scripts must be logged into the machine at all times so that the scheduled scripts run.

To enable this feature, you must select the Enable Script Scheduling checkbox in the IDEA Options dialog box.

Notes & Limitations

  • Compiled IDEAScript files (ISE) are not supported.
  • IDEA must be closed for a scheduled script to run.
  • It is recommended to run scheduled scripts on a dedicated machine.
  • If not on a dedicated machine, only schedule script run times on off-hours (when you are not using IDEA and IDEA is not running).
  • You cannot schedule scripts located in the Local Library.
  • You cannot schedule multiple scripts simultaneously.
  • You cannot schedule multiple scripts to run at exactly the same time. To ensure that you give your scripts sufficient time to run completely before the next script is set to run.
  • Email Notifications: To receive schedule script alerts, IDEA must alter the registry. This may affect other applications. It is recommended to backup the registry before configuring alerts for scheduled scripts.
  • The Schedule feature makes use of the Windows Task Scheduler feature. Verify your Windows Task Scheduler settings. Note that when you enable the Schedule feature, the Run with highest privileges option (Windows Task Scheduler setting) is always enabled.

To set a schedule for a script:
1. Click the Library tab.
The Library window appears.
2. From the Current Project Library, expand the Macros mode.
3. Right-click a script and select Schedule.
The Schedule dialog box appears.
4. Click the Schedule tab to select a schedule type.
5. Optionally, set up an alert.
6. Click OK.
A message appears reminding you that IDEA must be closed for scheduled scripts to run.
7. Optionally, click the Do not show this message again check box to stop showing the reminder every time you schedule a script.
You can set an option in the Systems tab of the IDEA Options dialog box to show/hide the reminder message.
8. Click OK.

WOW! So, what does this mean to the average user? Let’s say that you have a script or scripts that you would like to run overnight, on the weekends or on a specific day each month.

Prepare your Script(s)

  1. Confirm that each script will run to completion, no errors or pop up message boxes requiring user response.
    • Include at beginning of each script (below the line SUB MAIN)
      • IgnoreWarning(True)
        • Do not prompt to overwrite pre-existing file.
      • Client.WorkingDirectory = “full path of IDEA Project Folder
        • This line is if you want or need to schedule multiple scripts
      • OnError Resume Next
        • Error handling helps to ensure the script runs to completion. See IDEA Help – OnError for more detailed information and alternative methods.
      • Include at end of Sub Main (just above the line END SUB)
        • Client.Quit
          • This line ensures that IDEA closes when the script completes.
  1. Confirm that the input files will have same name and structure for each run if you have not scripted to provide for name change.

 

Calling Another MacroHow to run multiple scripts:
From http://www.ideascripting.com/forum/using-multiple-scripts

  1. Client.RunIDEAScript ( pathName As String ) this will simply run a script
  2. Client.RunIDEAScriptEx ( fileName As String, arg1 As Variant, arg2 As Variant, arg3 As Variant, arg4 As Variant ) in this script you can send up to 4 variables to the script
  3. Client.RunIDEAScriptRV ( scriptName As String, arg1 As Variant, arg2 As Variant, arg3 As Variant, arg4 As Variant ) this one will return 4 variables to the main script.

Each script will complete prior to starting the next one.

Example:
Sub Main

Dim workDir As String
‘Get current project folder
workDir = Client.WorkingDirectory

‘Testing Managed Project-local drive
Client.RunIDEAScript “C:\Users\MyUserName\Documents\My IDEA Documents\IDEA Projects\ProjectName\Macros.ILB\MacroName.iss”
‘Testing External Project-local drive
Client.RunIDEAScript “D:\Local Drive External IDEA Projects\ProjectName\Macros.ILB\MacroName.iss”
‘Testing External Project-network drive
Client.RunIDEAScript “P:\Network Drive External IDEA Projects\ProjectName\Macros.ILB\MacroName.iss”

‘Return to original project folder
Client.WorkingDirectory = workDir

‘Exit IDEA program
Client.Quit
End Sub

Test again for errors!

You have just created a master script that calls previously tested individual macros located in either managed or external project folders to run one right after the other in a specific order.

 Set-up

  1. You must be able to run IDEA as administrator. You can either RIGHT-CLICK Run as administrator each time you need to configure/schedule a script to run.

Or you can set the properties on your shortcut to automatically Run as administrator. Select SHORTCUT tab, ADVANCED check RUN AS ADMINISTRATOR then click OK and OK.

  1. IDEA – Configure Script Scheduling under FILE-OPTIONS, System menu

Schedule the Script

  1. Run IDEA.exe as administrator to schedule the script. Right-Click Run as administrator.

    1. Switch to the library tab of the project where the script is stored, RIGHT-CLICK on the script name and select SCHEDULE.

3. Select your frequency, next date to run and time to start.

 

  1. If you set an Alert, IDEA will modify your Windows Registry settings, please see IDEA HELP for more detail. MS Outlook 64-bit must be installed and set as your default mailer.

 

  • Sample Notification:

  1. Script will now show up with a clock and when you select to display SCHEDULE it will display the details.

IDEA 11.1 was released 2-March-2020

 


Best Practices , Tech Tip



Posted By

By Kris Willison
Kris joined the Professional Services team in January of 2015 as a Solutions Specialist. She has an extensive background in Software and Database Development accumulated from thirty years in IT support with twenty years’ experience in database development, cleanup, audit and migration using Microsoft Access. In her time with Audimation, she has received client praise for her “Top Tier” engagement on Monitor and Scripting projects. Kris enjoys looking at problems from new angles to determine the most efficient means of meeting the clients’ needs. Kris has been breeding/showing purebred Balinese cats since 1972 and Oriental Longhairs since 1996. She also hosts one of the largest online pedigree database sites for Siamese and related breeds with nearly 600 users worldwide.


Related Posts
Unconventional Analysis
Jan 24 Data is often underutilized. The opportunity to use data analytics to gain insights, add more value and unravel opportunities are endless. We’ve rounded up a ...
Date Fields Importing into IDEA as Character Type Fields
Aug 02 Why are my date fields importing into IDEA as character type fields?   If you are importing from Excel, the date column needs to be formatted as a date t...
Exporting Data from 3 Commonly Used Applications
Jun 16 Before any work can be done in IDEA, you’ll first need to acquire the data to be analyzed. Here are the steps to export data from three commonly used a...
BROWSER NOT SUPPORTED

This website has been designed for modern browsers. Please update. Update my browser now

×