[OMC] Nib question...

OnMyCommand discussion omc at abracode.com
Mon Dec 28 22:38:31 PST 2009


You need to set up a separate dialog initialization subcommand. It will be called right before showing the dialog.
You set the init subcommand id in nib pane in OMCEdit (INIT_SUBCOMMAND_ID tag) or use default "omc.dialog.initialize". In this subcommand you can use omc_dialog_control to set the initial control values.
Hope it helps,
Tom
Abracode

On Dec 27, 2009, at 7:22 AM, OnMyCommand discussion wrote:

> Hi,
> 
> I'm creating a simple nib interface for tagging files using Openmeta.
> 
> What I would like to do is have Openmeta read any existing tags from a file and pass them to an editable Text field in the nib dialog. Then after adding or deleting tags from the dialog ... hit enter and have Openmeta clear any old tags and then write the new tags to the file.
> 
> The issue I'm having is utilizing only one Text field. When my command is executed the window pops up, but the text field is empty ... well at least until I hit enter, then one of the preexisting tags from the file is loaded into the text field (not all, just the first tag).
> 
> The actual tagging portion of the command works fine (i.e. typing in tags and hitting enter).
> 
> I haven't implemented the clearing of old tags yet, but here is what I have.
> 
> Any ideas on how to get the existing tags to load in the text field? or if it's even possible?
> 
> Thanks!
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> 	<key>COMMAND_LIST</key>
> 	<array>
> 		<dict>
> 			<key>ACTIVATION_MODE</key>
> 			<string>act_file_or_folder_not_finder_window</string>
> 			<key>CATEGORIES</key>
> 			<array>
> 				<string>Tag</string>
> 				<string>Meta Data</string>
> 			</array>
> 			<key>ESCAPE_SPECIAL_CHARS</key>
> 			<string>esc_with_backslash</string>
> 			<key>EXECUTION_MODE</key>
> 			<string>exe_silent_popen</string>
> 			<key>MULTIPLE_OBJECT_SETTINGS</key>
> 			<dict>
> 				<key>PREFIX</key>
> 				<string></string>
> 				<key>PROCESSING_MODE</key>
> 				<string>proc_together</string>
> 				<key>SEPARATOR</key>
> 				<string> </string>
> 				<key>SEPERATOR</key>
> 				<string></string>
> 				<key>SORT_METHOD</key>
> 				<string>sort_none</string>
> 				<key>SUFFIX</key>
> 				<string></string>
> 			</dict>
> 			<key>NAME</key>
> 			<array>
> 				<string>Tagger</string>
> 			</array>
> 			<key>NIB_DIALOG</key>
> 			<dict>
> 				<key>IS_BLOCKING</key>
> 				<false/>
> 				<key>IS_COCOA</key>
> 				<true/>
> 				<key>NIB_NAME</key>
> 				<string>tagger</string>
> 			</dict>
> 			<key>NOTES</key>
> 			<string>openmeta version 0.1 by Tom Andersen code.google.com/p/openmeta/ 
> 
> Usage: openmeta [options] -p PATH[s] 
> 
> Note that commas are to be used nowhere - tag lists use quotes for two word tags in output
> 
> example (list tags and ratings):  openmeta -p PATH
> example (list tags and ratings multiple):  openmeta -p PATH PATH
> example (list tags): openmeta -t -p PATH[s]
> example (add tags): openmeta -a foo bar -p PATH[s]
> example (add tags with spaces): openmeta -a "three word tag" "foo bar" -p PATH[s]
> example (set tags):  openmeta -s foo bar -p PATH[s]
> example (clear all tags):  openmeta -s -p PATH[s]
> example (set managed):  openmeta -m Y -p PATH[s]
> example (set rating 0 - 5 stars):  openmeta -r 3.5 -p PATH[s]
> example (print rating):  openmeta -r -p PATH[s]
> example (clear rating):  openmeta -r 0.0 -p PATH[s]
> example (lousy rating):  openmeta -r 0.1 -p PATH[s]</string>
> 			<key>SUBMENU_NAME</key>
> 			<string>..</string>
> 			<key>VERSION</key>
> 			<integer>1</integer>
> 		</dict>
> 	</array>
> 	<key>VERSION</key>
> 	<integer>2</integer>
> </dict>
> </plist>
> 
> 
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> 	<key>COMMAND_LIST</key>
> 	<array>
> 		<dict>
> 			<key>ACTIVATION_MODE</key>
> 			<string>act_always</string>
> 			<key>COMMAND</key>
> 			<array>
> 				<string>current=$(/usr/local/bin/openmeta -p </string>
> 				<string>__OBJ_PATH__</string>
> 				<string> | grep tags | tr -d '\r' | sed -e 's/tags://g');
> /Library/Frameworks/Abracode.framework/Versions/A/Support/omc_dialog_control </string>
> 				<string>__NIB_DLG_GUID__</string>
> 				<string> 1 $current;
> /usr/local/bin/openmeta -a </string>
> 				<string>__NIB_DIALOG_CONTROL_1_VALUE__</string>
> 				<string> -p </string>
> 				<string>__OBJ_PATH__</string>
> 				<string></string>
> 			</array>
> 			<key>COMMAND_ID</key>
> 			<string>Tags</string>
> 			<key>ESCAPE_SPECIAL_CHARS</key>
> 			<string>esc_with_backslash</string>
> 			<key>EXECUTION_MODE</key>
> 			<string>exe_silent_popen</string>
> 			<key>MULTIPLE_OBJECT_SETTINGS</key>
> 			<dict>
> 				<key>PREFIX</key>
> 				<string></string>
> 				<key>PROCESSING_MODE</key>
> 				<string>proc_together</string>
> 				<key>SEPARATOR</key>
> 				<string> </string>
> 				<key>SEPERATOR</key>
> 				<string></string>
> 				<key>SORT_METHOD</key>
> 				<string>sort_none</string>
> 				<key>SUFFIX</key>
> 				<string></string>
> 			</dict>
> 			<key>NAME</key>
> 			<array>
> 				<string>Tagger</string>
> 			</array>
> 			<key>NOTES</key>
> 			<string>openmeta version 0.1 by Tom Andersen code.google.com/p/openmeta/ 
> 
> Usage: openmeta [options] -p PATH[s] 
> 
> Note that commas are to be used nowhere - tag lists use quotes for two word tags in output
> 
> example (list tags and ratings):  openmeta -p PATH
> example (list tags and ratings multiple):  openmeta -p PATH PATH
> example (list tags): openmeta -t -p PATH[s]
> example (add tags): openmeta -a foo bar -p PATH[s]
> example (add tags with spaces): openmeta -a "three word tag" "foo bar" -p PATH[s]
> example (set tags):  openmeta -s foo bar -p PATH[s]
> example (clear all tags):  openmeta -s -p PATH[s]
> example (set managed):  openmeta -m Y -p PATH[s]
> example (set rating 0 - 5 stars):  openmeta -r 3.5 -p PATH[s]
> example (print rating):  openmeta -r -p PATH[s]
> example (clear rating):  openmeta -r 0.0 -p PATH[s]
> example (lousy rating):  openmeta -r 0.1 -p PATH[s]</string>
> 			<key>SUBMENU_NAME</key>
> 			<string>..</string>
> 			<key>VERSION</key>
> 			<integer>1</integer>
> 		</dict>
> 	</array>
> 	<key>VERSION</key>
> 	<integer>2</integer>
> </dict>
> </plist>
> 
> 
> 
> _______________________________________________
> OMC mailing list
> OMC at abracode.com
> http://abracode.com/mailman/listinfo/omc_abracode.com




More information about the OMC mailing list