Hi,
I am trying to create AppleScript, which will do a screenshot of a web page from a list of URL. Given URL is following:
https://www.website.com/?2015-02-23-18,blabla
where 2015-02-23 is a date, 18 is an hour I need to create a screenshot of 100 consequent days at the same time.
First approach:
- open file read all URLs and create a variable
- open a window with a first URL
- do javascript which will disable certain function of the website
- create a screenshot
- repeat step 2 with other URL
- if there is no other URL stop
Second approach:
- substitute months and dates [2015-02-23] with variables
- do repeat of open window with URL which includes first variable set
- do java script to disable some function of the URL
- create a screenshot
- do 2. with the second variable
- stop at 2016-08-31
I was working on the first approach and I got stacked at opening list of variables.
My code so far is following:
set myList to every paragraph of (read "/Users/tomas/desktop/sites.txt")
set numURLs to (count myList)
set tot to count numURLs
repeat with i from 1 to tot
set p to item i of tot
tell application "Google Chrome"
make new window
set URL of active tab of window 1 to p
execute front window's active tab javascript "document.getElementById('menu').style.display = 'none';"
delay 1
do shell script "date=$(date '+%m%dT%H%M%S'); screencapture -x -R0,102,1500,500 ~/Desktop/Windyty${date}$.jpg"
end tell
end repeat
Can someone help me with this?
Thank you
Tomas
Model: MacBook Pro (15-inch, Late 2008)
AppleScript: Version 2.8.1 (183.1)
Browser: Safari 601.6.17
Operating System: Mac OS X (10.10)