Hallo
Ich möchte per AppleScript prüfen, ob bestimmter Text in einem Text-File vorhanden ist. Ich habe bereits einen ersten Ansatz, doch leider funktioniert es nicht. Kann mir jemand sagen was ich falsch gemacht habe?
set stringContainsName to false
set tString to "test"
set tNames to "/Users/Philipp/Desktop/test.txt"
repeat with aName in paragraphs of tNames
if aName is in tString then set stringContainsName to true
end repeat
if stringContainsName then
display dialog "enthalten"
else
display dialog "nicht enthalten"
end if
Vielen Dank
Philipp
Ich möchte per AppleScript prüfen, ob bestimmter Text in einem Text-File vorhanden ist. Ich habe bereits einen ersten Ansatz, doch leider funktioniert es nicht. Kann mir jemand sagen was ich falsch gemacht habe?
set stringContainsName to false
set tString to "test"
set tNames to "/Users/Philipp/Desktop/test.txt"
repeat with aName in paragraphs of tNames
if aName is in tString then set stringContainsName to true
end repeat
if stringContainsName then
display dialog "enthalten"
else
display dialog "nicht enthalten"
end if
Vielen Dank
Philipp