Last active
December 15, 2015 08:49
-
-
Save mnicovideo/5234020 to your computer and use it in GitHub Desktop.
create dynamic script object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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