You have the following line in your script:
set _image to do shell script ("screencapture -t jpg -x " & _folder & "/" & _date & "_" & _time & "_ScreenLine" & ".jpg“)
Immediately after this line, insert the following:
return _image
This will terminate the script at that point, whilst also returning the value that gets stored in the variable _image, which will appear in the result’s pane at the bottom of Script Editor.
I haven’t test your script, but I do know that the shell command screencapture doesn’t return any output to stdout. Therefore, I’m guessing you’ll probably find that your variable _image contains an empty string, “”. If so, that’ll be a big part of why the second half of your script doesn’t do anything.
People have different ways of debugging their scripts to isolate where problems originate. I tend to laboriously insert return %some var% statements after lines I want to investigate to obtain the value of some variable. It’s not the best method, but old habits die hard. Other people choose to display dialogs at various points in their script to get a glimpse of the contents of a variable whilst allowing execution of the script to continue. Then there’s the excellent Script Debugger by Late Night Software, which not only keeps an itemised list of variables along with their values at the end of a script’s run for you to peruse, but also has a fully-fledged debug mode that allows step-by-step line execution of a script and examination of variables and expressions at any given point.
Another thing you can do is get rid of your try and end try statements, because there’s no need for them in the way that you’ve got it currently set up. All it’s done, unfortunately, is stopped an error from terminating your script, which—had it not done so—would have allowed the error to be caught, thus terminating your script and reporting to you the reason why:
error "Image Events got an error: Can’t make \"\" into type specifier." number -1700 from "" to specifier
which I just got by running the command
tell application "Image Events" to save "" with compression level low
[ EDIT: Actually, this isn’t quite true, since you have a repeat loop (the inner one) that I just realised won’t ever be entered because _image will be an empty string, which has nothing to loop over. So the script wouldn’t have thrown an error; it would simply run to the end (and then repeat again because of your outer loop). Nonetheless, still a good idea to remove the try statement anyway. ]