# Define the path to the storage folderset destFolder to (path to downloads folder as text) # edit to fit your needs
# Builds the URL
set XMLbrut to do shell script "curl -Ls -A 'Opera/9.70 (Linux ppc64 ; U; en) Presto/2.2.1' " & result
tell (current date) to set fileName to (((its year) * 10000 + (its month) * 100 + (its day)) as text) & "_" & text 2 thru -1 of ((1000000 + (its hours) * 10000 + (its minutes) * 100 + (its seconds)) as text) & ".txt"
my writeto(destFolder & fileName, XMLbrut, «class utf8», false)
#=====
(*
*)
on writeto(targetFile, theData, dataType, apendData)
# targetFile is the path to the file you want to write
# theData is the data you want in the file.
# dataType is the data type of theData and it can be text, list, record etc.
# apendData is true to append theData to the end of the current contents of the file or false to overwrite it
try
set targetFile to targetFile as text
set openFile to open for access file targetFile with write permission
if not apendData then set eof of openFile to 0
write theData to openFile starting at eof as dataType
close access openFile
return true
on error
try
close access file targetFile
end try
return false
end try
end writeto
#=====
Yvan KOENIG running El Capitan 10.11.4 in French (VALLAURIS, France) jeudi 12 mai 2016 18:51:18