I've got a scrolling text field (photosList) that accepts drag-n-drop filenames for photos. So far, the drag-n-drop code is working, and filenames are successfully added to the field.
If the user needs to remove one or more filenames from the list, I've added a button/script that puts the hilitedLine results into tLines. I then try to delete these lines with delete line tLines of field "photosList". This works great if only one line was selected, but it fails when tLines contains more than one line.
Any ideas on how to accomplish a multi-line delete from a scrolling text field? A different approach, perhaps?
thanks,
Robert
Using Delete Line with HilitedLine results
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Hi Robert,
if there are more than one line selected "the hilitedlines" return something like "1,4,5,7"!
So "delete line tLines of fld xyz" will of course not work.
You will have to use a repeat loop and start with the LAST item in tLines:
...
repeat with i = the number of items of tLines down to 1
## we have to start from the end!
delete line (item i of tLines) of fld xyz
end repeat
...
Hope that helps.
Regards
Klaus
if there are more than one line selected "the hilitedlines" return something like "1,4,5,7"!
So "delete line tLines of fld xyz" will of course not work.
You will have to use a repeat loop and start with the LAST item in tLines:
...
repeat with i = the number of items of tLines down to 1
## we have to start from the end!
delete line (item i of tLines) of fld xyz
end repeat
...
Hope that helps.
Regards
Klaus