Take screenshot of screenshot with AppleScript
As with any script that tries to control the UI, this script is brittle and relies on sufficient delays to give the Quick Look window time to form and the image to be painted.  Although the script does check for the window's existence, it cannot check to make sure that the contents of the window has been painted, so I have had variable results in testing, including some good successes:

tell application "Finder"
    if selection = {} then return
    try
        make new folder with properties {name:"Infinity"}
    end try
    set sourcefile to duplicate item 1 of (get selection) to folder "Infinity"
    select the sourcefile
    activate
end tell

repeat with i from 1 to 50
    tell application "System Events"
        keystroke space
        set _W to (a reference to window "Quick Look" of process "Finder")
        repeat until _W exists
            delay 0.5
        end repeat

        delay 1 -- Give time for window to paint

        set [x, y] to _W's position
        set [w, h] to _W's size

        set my text item delimiters to ","
        set R to {x, y, w, h} as text
    end tell

    set my text item delimiters to {".", ":"}
    set filename to "screen shot " &amp; ((current date) as «class isot» as string) &amp; ".jpg"
    set filename to text items of filename as text

    do shell script "screencapture -R " &amp; R &amp; " -t jpg ~/Desktop/Infinity/" &amp; ¬
        (quoted form of the filename)

    tell application "System Events"
        keystroke space
        repeat until not (_W exists)
            delay 0.5
        end repeat
    end tell

    tell application "Finder" to select file filename in folder "Infinity"
end repeat


You must ensure the necessary accessibility privileges are granted for this script to run.



Note: This script was written and tested using AppleScript version: 2.7  System version: 10.13.6