-
-
Save benwaldie/5687768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get the text from Safari | |
tell application "Safari" | |
set thePageText to text of document 1 | |
end tell | |
-- Split the text into paragraphs | |
set thePars to paragraphs of thePageText | |
-- Find all paragraphs matching the desired criteria | |
set theText to "" | |
repeat with aPar in thePars | |
if aPar contains "www.myrepospace.com/profile" then | |
set theText to theText & (aPar & return as string) | |
end if | |
end repeat | |
-- Write the paragraphs to a file on the Desktop | |
set theOutputFile to (path to desktop folder as string) & "Results.txt" | |
try | |
set theOutputFile to open for access theOutputFile with write permission | |
write theText to theOutputFile starting at eof | |
close access theOutputFile | |
on error | |
close access theOutputFile | |
end try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment