Hallo liebe ScripterInnen,
hätte ein Frage: Text Sucker ist ein nettes Tool zur Textextraktion aus QXP-Files. Ich wollte nun den Text MIT Tags herausschreiben lassen. Dafür steht auch eine alternative Zeile im Code, die ich nur verwenden muss. Das Problem ist aber, dass ich folgende Fehlermeldung bekomme:
Syntax Error
Es wurde „„"““ erwartet, aber ein „Unbekanntes Token“ wurde gefunden.
Hat da jemand einen Tipp??? Merci und viele Grüße, Gerd
Hier mal der Bereich des Codes. Es geht um die den Teil mit: set theReps to
on QXPcleanUpText(aFile)
set theFinds to {15, 16, 7, 11, 12, 0, 1, 4, 29, 30, 31, 2, 3, 17, 18, 19, 20, 127}
set theReps to {"<\q>", "<\p>", "<\n>", "<\c>", "<\b>", "","", "<\#>", "<\d>", "<\i>", "<\h>", "", "", "", "", "", "", ""}
--set theReps to {"<\q>", "<\p>", "<\n>", "<\c>", "<\b>", "","", "<\#>", "<\d>", "<\i>", "<\h>", "", "", "", "", "", "", ""} -- in case you want XPress tags inserted
-- set theReps to {" ", " ", return, return, return, "", "", "", "", "", "", "", "", "", "", "", "", ""} in case you want NO Xpress tags inserted
set fileRef to (open for access file aFile)
set fileRef2 to (open for access file (aFile & "*") with write permission)
set eof fileRef2 to 0
set chunkSize to 8192
set fileSize to (get eof fileRef)
if chunkSize > fileSize then -- would cause error
set chunkSize to fileSize
end if
set oldDelims to AppleScript's text item delimiters
repeat
try
set aChunk to read fileRef for chunkSize
on error -- end of file
exit repeat
end try
repeat with i from 1 to count of items of theFinds
set AppleScript's text item delimiters to ASCII character (item i of theFinds)
set aChunk to text items of aChunk
set AppleScript's text item delimiters to (item i of theReps)
set aChunk to aChunk as text
end repeat
write aChunk to fileRef2
end repeat
close access fileRef
close access fileRef2
set AppleScript's text item delimiters to oldDelims
end QXPcleanUpText