[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Apple Events with complex parameter objects



I am trying to write Apple Events code to mimic the following AppleScript,
which does a finder copy of several files into a folder. The file list
varies in names and number of files, so it cannot be precompiled.

----------

tell application "Finder"
copy{file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:MPI 3510",Â
file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:PR 7521",Â
file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:TM 176DYP",Â
file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:WW 0010",Â
file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:WW 007",Â
file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:WW 014",Â
file "Hard Drive:Projects:OPI->APR:Test Pages:PE Pg  4:WW 0012"}Â
to folder "brisque8.1.0:HiRes:90234"
end tell

----------

I used the Capture AE control panel to grab the Apple Events generated by
this AppleScript. I added some line breaks for clarity.

----------

Process("Finder").SendAE "core,clon,'----':

[obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:MPI 3510", from:'null'()},

obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:PR 7521", from:'null'()},

obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:TM 176DYP", from:'null'()},

obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:WW 0010", from:'null'()},

obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:WW 007", from:'null'()},

obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:WW 014", from:'null'()},

obj {form:name, want:type(file), seld:"Hard Drive:Projects:OPI->APR:Test
Pages:PE Pg  4:WW 0012", from:'null'()}],

insh:

obj {form:name, want:type(cfol), seld:"brisque8.1.0:HiRes:90234",
from:'null'()}, &subj:'null'()"

----------

I have been reading Chris Nandor's AppleEvent tutorial, which is excellent.
But I can't figure out how to build complex parameter objects as above. Can
anyone guide me in the right direction?


William B. Birkett
Precision Color, Inc.
9200 General Drive
Plymouth, MI 48170 (USA)

Phone: (734) 459-5640
FAX:   (734) 459-4210




***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch