Skip to content

Instantly share code, notes, and snippets.

@mnicovideo
Last active December 15, 2015 08:49
Show Gist options
  • Save mnicovideo/5234020 to your computer and use it in GitHub Desktop.
Save mnicovideo/5234020 to your computer and use it in GitHub Desktop.
create dynamic script object.
on createTheObject(objectName)
run script "
script " & (objectName as text) & "
property theProp : missing value
on theHandler()
log theProp
end theHandler
end script
return " & (objectName as text)
end createTheObject
set ObjectList to {}
repeat with num from 1 to 1024
set anObject to createTheObject("Object_" & num)
set theProp of anObject to "hello" & num as text
set the end of ObjectList to anObject
end repeat
set theProp of item (count ObjectList) of ObjectList to "こんにちは"
repeat with i from 1 to count ObjectList
tell item i of ObjectList to theHandler()
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment