so in my script you manually (in the script) set the variables for how long you want to delay and how many times to repeat. So like I want my script so you can choose a script file and stick it’s contents within the other script…confusing i know…but here is my code
set user_time to "120" as string
set x to "5" as string
repeat x times
--chosen script contents here--
delay user_time
end repeat
Sounds like you want to just run the chosen script a certain number of times with a given delay?
You could do it like this…
set user_time to "120" as string
set x to "5" as string
set scriptFile to choose file with prompt "Please select the script to run"
repeat x times
tell application "Finder" to open scriptFile
delay user_time
end repeat
set user_time to "120" as string
set x to "5" as string
set scriptFile to choose file with prompt "Please select the script to run"
repeat x times
run script scriptFile
delay user_time
end repeat
Or you can use a “script object” construction like this:
set delayTime of myDelay to 120
set delayRuns of myDelay to 5
tell myDelay to run_me()
script myDelay
property delayTime : 0
property delayRuns : 0
on run_me()
display dialog "delayTime is " & delayTime & ". Runs = " & delayRuns
end run_me
end script