Cocoa loco
Cocoa loco
- Subject: Cocoa loco
- From: John Delacour <email@hidden>
- Date: Sun, 2 Mar 2003 12:50:22 +0000
- Mac-eudora-version: 6.0a8
At 3:41 pm -0800 28/2/03, somebody wrote:
If you have constructive feedback on how AppleScript does or does
not work, that's fine...
My problem with this is that there seem to be two Applescripts -- on
the one the Applescript that other people and, occasionally in the
past (cf. Scriptable Text Editor, WorldText, Claris Emailer) Apple
have developed and implemented and on the other a stange perversion
of this now being developed and implemented by people with no
apparent knowledge or respect for the language as we have known it.
It is difficult for me to be "contructive" other than to suggest that
those currently charged with Applescript deconstruction get their act
together.
I could list dozens of newly invented anomalies with reference to
Mail and TextEdit, but the script below, followed by the output of
the Event Viewer, will show the difference between properly behaved
applications and the new breed.
All sane applications return a reference as the result of the 'make'
command. Mail does not and TextEdit insists on a location reference
for 'make; in spite of the dictionary giving this reference as
optional. It is absurd to insist on a location reference for a new
window or document when only one location is possible.
make : Make a new object.
make
[at location reference] -- The location at which to insert the object.
tell application "Tex-Edit Plus" -- 3rd Party
make window
make document
end tell
tell application "BBEdit 6.5" -- 3rd Party
make window
make document
end tell
tell application "Smile" -- -- 3rd Party
make text window
end tell
tell application "WorldText" -- Apple a while ago
make window
make document
end tell
tell application "TextEdit" -- Apple now
try
make window
on error e
log e
end try
try
make document
on error e
log e
end try
make new window at end of windows
make new document at end of documents
end tell
tell application "Mail" -- Apple now
tell me to set d to "1/1/1"
tell me to set d to "" & (current date) - (get date d)
make mailbox with properties {name:d}
delay 2
delete mailbox d
end tell
________________
tell application "Tex-Edit Plus"
make new window
--> window 1
make new document
--> window 1
end tell
tell application "BBEdit 6.5"
make new window
--> text window 1
make new document
--> text document 1
end tell
tell application "WorldText"
make new window
--> document "untitled 9"
make new document
--> document "untitled 10"
end tell
tell application "Smile"
make new text window
--> text window id 9
end tell
tell application "TextEdit"
make new window
(*NSArgumentsWrongScriptError*)
make new document
(*NSArgumentsWrongScriptError*)
make new window at end of every window
--> window id 19780
make new document at end of every document
--> document 1
end tell
tell current application
current date
--> date "Sunday, March 2, 2003 12:14:51 pm"
end tell
tell application "Mail"
make with properties {name:"68300091"} new mailbox
delete mailbox "68300091"
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.