Global variables usage


I have created couple of handlers like this…


to CreateScreenshotsDirectoryFolder
delete global screenshotsDirectory
global screenshotsDirectory
put formattedTime("%Y%B%d—%I-%m%p") into global screenshotsDirectory
put “/…/…blah…blah. dir name…/” before global screenshotsDirectory

create new folder global screenshotsDirectory

end CreateScreenshotsDirectoryFolder


to CaptureSpecificScreen

MoveTo "SpecificPosition"
wait 2

put global screenshotsDirectory into SpecificPageName

put  "/SpecificPage.jpeg" after SpecificPageName

end CaptureSpecificScreen

Here, I have declared “screenShotsDirectory” as a global variable for setting folder name. But it does always refresh with new timestamp value. (Eventhough for each execution, I am deleting the global value and recreating it) I am seeing that always time stamp generated and folder created with specific time. For e.g. all my runs today created new folder only every 3rd min of the hour(12:03 pm , 1:03 pm, 2:03 pm …etc) instead of refreshing each time I execute the script. I have tried saving the scripts, quitting the eggplant etc…but why the timeframe not refreshed is a wonder…can you please help what I need to take care of…

Vasavi Kaza

The problem is the format you’ve used in the formattedTime() function. The “%m” code is the month number (currently 03) – to get the minute you need to use “%M” instead.

Thanks a lot…

Silly mistake of mine…

Also, I think you’re wanting to delete the directory before creating the new one? This line:

delete global screenshotsDirectory

isn’t deleting anything. If you want to delete the actual directory, you need to say:

delete folder global screenshotsDirectory