Code: Select all
on writehtmlfile fileTowrite,dataTowrite
set the defaultFolder to (specialFolderPath("Documents") &"/Contents")
put dataTowrite into URL (("file:"&fileTowrite&".html"))
end writehtmlfile
on mouseUp
if the environment = "development" then touchEnd 1
local tURL, tFile
get url "http(:)//mywebsite.php"
put it into url
replace"[" with "" in url
replace "]" with "" in url
set itemdelimiter to ","
put item 1 of urlA into myvalue1
get char 2 of myvalue1
put it into thevalue
put "p" & thevalue into thefile
replace "," with "" in thefile
put "http(:)//mywebsite.php?=pg" & thevalue into updated
put url updated into thehtml
writehtmlfile thefile,thehtml
answer "Updated"
end mouseUp
The website only gives a text of an array ----> ["1", "2"]
So, I was able to get the value 1 and 2 out into a variable but I'm afraid that it would give me even more numbers, therefore I need to make a loop for it.
However, I am unable to think of a way of how to make the loop have their own variables to get the number to update the files.
Any help? Thanks!!
