Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A few questions: AMPathPopupButton, AMName, Error reporting, docs



Hi,

I'm building my first Automator action (Objective-C) and had a few questions:

AMPathPopupButton (Set to allow the user to choose directories - new or existing)
1. When my action comes up, the popup defaults to Desktop. However, when I query my parameters, the value for the bound key is nil. I know I have the bindings right, because if the user clicks the popup and re-selects Desktop, I get the value. So basically it looks like this doesn't actually send the value until the user clicks the drop- down at least once - even though Desktop shows as the default value. Is there any way to make sure I get this automatically? Do I just query it in my run method? (This seem to defeat the purpose of bindings).


2. The popup allows the user to create a new folder and use that. However, when my code gets the value, the new folder doesn't exist - so I have to create it in these cases. Is this the way AMPathPopupButton is supposed to work? Seems like if it allows the user to specify the name of a new folder, it should create it for me?

3. It doesn't look like AMPathPopupButton is in the documentation? (All I can find when I search the docs on my machine is the bindings reference for this class) Am I just missing it?

Error reporting
1. The Automator documentation says that an Objective-C action should return an error dictionary containing two keys: OSAScriptErrorNumber and OSAScriptErrorMessage. However, these constants are not defined in any of the includes that the default Cocoa Action template includes. Additionally, none of the example actions in /Developer/ Examples/Automator use these constants either. One of the example actions uses NSAppleScriptErrorMessage as the constant - which is included in the default template. So can I assume that NSAppleScriptErrorMessage and NSAppleScriptErrorNumber are OK to use? Should the docs be updated to this effect (and/or should I report a doc bug on this)?


Build Warning:
1. The default template for set my AMName to the same as my project and main class "DownloadColorFieldImages". I changed my AMName (and the localized version) to include spaces: "Download Color Field Images". However, the final step in the build process now gives me a warning:
"Folder name (DownloadColorFieldImages) does not match AMName (Download Color Field Images)"
How can I get rid of this warning or fix my setup so that the folder name and AMName match? I quickly checked through my project and target settings, but didn't see anything that looked like it would fix this.


Thank you,
Blake
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/automator-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.