How to make a macro for plot profile results data into Excel given time-points for reference?

Hello, I am a novice user and would appreciate any assistance I could receive.
In ImageJ, I am working with a stack of images that I need a plot profile of but only at Frame 21 and Frame 81.
I am attempting to make a macro that allows me to essentially execute these exact commands accordingly:
Upload Image> Run ROI Manager> Load ROI> Plot Profile> Select |Live|> Scroll to Frame 21> Click |List|> Save Results to Sheet 1 in Excel> Scroll to Frame 81> Click |List|> Save Results to Sheet 2 in Excel

I tried using the Macro Recorder, but whenever I would try to scroll to the time of Frame 21 as well as try to select |Live| or |List| from within the Plot Profile window but the Macro Recorder does not seem to recognize any of this and is unable to translate these commands.

I found the attached macro that obtains profiles of all slices in the stack and figured that I could probably use it for what I am trying to do, however, I only want the values from Frame 21 to Frame 81:
Would someone be able to provide me with some guidance as to how I would go about making my own macro or how I may appropriately edit the one I had found so that I could just get the data at Frame 21 and Frame 81.
Thank you in advance,
Kevin Dela Roca

// StackProfileData
// This ImageJ macro gets the profile of all slices in a stack
// and writes the data to the Results table, one column per slice.
// Version 1.0, 24-Sep-2010 Michael Schmid

macro “Stack profile Data” {
if (!(selectionType()==0 || selectionType==5 || selectionType==6))
exit(“Line or Rectangle Selection Required”);

 run("Plot Profile");
 Plot.getValues(x, y);
 run("Clear Results");
 for (i=0; i<x.length; i++)
     setResult("x", i, x[i]);
 n = nSlices;
 for (slice=1; slice<=n; slice++) {
     showProgress(slice, n);
     profile = getProfile();
     sliceLabel = toString(slice);
     sliceData = split(getMetadata("Label"),"\n");
     if (sliceData.length>0) {
         line0 = sliceData[0];
         if (lengthOf(sliceLabel) > 0)
             sliceLabel = sliceLabel+ " ("+ line0 + ")";
     for (i=0; i<profile.length; i++)
         setResult(sliceLabel, i, profile[i]);