How can I delete a specific line of a .txt file in AppleScript?
Here's a do shell script AppleScript command solution using sed to delete the target line of the target file, in-place.

set targetFile to "/Users/Me/Desktop/My Documents/My Fruit Log.txt"
set lineNumberToErase to 8

do shell script "sed -i '' -e '" &amp; lineNumberToErase &amp; "d' " &amp; quoted form of targetFile




If you want a backup of the target file made, change the sed option -i '' to -i '.bak', e.g.:

do shell script "sed -i '.bak' -e '" &amp; lineNumberToErase &amp; "d' " &amp; quoted form of targetFile