reusing a date/time name in a script

Step 1: We have a script where we are naming a story with a date/time filename (using typetext the shortdate and typetext the abbrev time) in order to make it unique.

Step 2: We want to be able to later search (by entering it in a text field) for that filename that we just created in step 1, and find that story, and work with it further.

Any ideas on the best way of doing this without using copy and paste?




  • EggplantMattEggplantMatt ForumAdmin admin
    Hi, Brad:

    Are you doing this later in the same script? If so, I would just create the filename in a variable and then TypeText that and call it again later in the script:
    put the short date & the abrev time into myFileName
    TypeText myFileName
    // other stuff happens here
    Click "FileNameSearchField"
    TypeText myFileName & return

    If you want this to be available across different called scripts or handlers then you can declare it as a global variable:
    put the short date & the abrev time into global myFileName
    TypeText myFileName
    // call to another script or handler
    Click "FileNameSearchField"
    TypeText global myFileName & return

    If by "later", you meant the next day or just during another Eggplant session, then you might want to write the value out to a file that you can read in whenever you need that information.

    Hope this helps.
Sign In or Register to comment.