Scripting PackageMaker
Scripting PackageMaker
- Subject: Scripting PackageMaker
- From: goochrules! <email@hidden>
- Date: Fri, 30 Jul 2004 14:52:54 -0600
I am attempting to write an AppleScript that given 3 directories
(source, intermediate, destination) will
1) create .mpkg and .pkg files from .pmsp and .pmsm files in the
source directory using PackageMaker
2) copy the .mpkg and .pkg files to the intermediate directory
and
3) create a .dmg from the intermediate directory with the name of the
intermediate directory + ".dmg" in the destination directory.
It all works great, except if when creating the packages -- command-k
in PackageMaker -- the package template actually creates something
with some content. Currently I am using UI Scripting Elements to poke
PackageMaker around, and my trouble comes with not waiting long enough
for things to happen before dismissing dialogs.
So, is there a way with AppleScript to figure out if these dialogs
have appeared?
here's the code in question:
on create_pkg(source, template)
tell application "Finder" to open the file template in the folder source
tell application "System Events"
-- hotkey to create the package
key down command
keystroke "k"
key up command
-- click 'save' on save dialog
delay 3
keystroke return
-- 'click 'replace' on the replace dialog (if necessary)
delay 1
keystroke return
-- 'click 'ok' on status dialog
delay 3
keystroke return
end tell
end create_pkg
-- Matthew Peltzer
-- email@hidden
_______________________________________________
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.