[OMC] Trouble with a Script... Thanks! (OnMyCommand discussion)

OnMyCommand discussion omc at abracode.com
Fri Jun 5 12:15:00 PDT 2009


You could try this Commandline tool ... haven't used it, but sounds  
like it might work.

http://www.bluem.net/downloads/cliclick-en/




On Jun 5, 2009, at 1:00 PM, omc-request at abracode.com wrote:

> Send OMC mailing list submissions to
> 	omc at abracode.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://abracode.com/mailman/listinfo/omc_abracode.com
> or, via email, send a message with subject or body 'help' to
> 	omc-request at abracode.com
>
> You can reach the person managing the list at
> 	omc-owner at abracode.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of OMC digest..."
>
>
> Today's Topics:
>
>    1. Re: Trouble with a Script... Thanks! (OnMyCommand discussion)
>    2. Re: Trouble with a Script... Thanks! (OnMyCommand discussion)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 4 Jun 2009 13:29:26 -0600
> From: OnMyCommand discussion <omc at abracode.com>
> Subject: Re: [OMC] Trouble with a Script... Thanks!
> To: omc at abracode.com
> Message-ID: <CB037D32-A89D-4D3A-8B41-27235D6DD661 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Thanks Tom :-)
>
> Looking forward to the update to Shortcuts!
>
>
>
> On Jun 4, 2009, at 1:00 PM, omc-request at abracode.com wrote:
>
>> Send OMC mailing list submissions to
>> 	omc at abracode.com
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> 	http://abracode.com/mailman/listinfo/omc_abracode.com
>> or, via email, send a message with subject or body 'help' to
>> 	omc-request at abracode.com
>>
>> You can reach the person managing the list at
>> 	omc-owner at abracode.com
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of OMC digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: Trouble with a Script... (OnMyCommand discussion)
>>
>>
>> --------------------------------------------------------------------- 
>> -
>>
>> Message: 1
>> Date: Wed, 03 Jun 2009 14:01:02 -0700
>> From: OnMyCommand discussion <omc at abracode.com>
>> Subject: Re: [OMC] Trouble with a Script...
>> To: <omc at abracode.com>
>> Message-ID: <C64C329E.65739%tom-old at abracode.com>
>> Content-Type: text/plain;	charset="US-ASCII"
>>
>> I did not try to run this command but just looking at it, it seems
>> you have
>> escaping problems:
>> 1. when using $path put it in quotes: "$path"
>> 2. you set ESCAPE_SPECIAL_CHARS to esc_with_backslash and yet you
>> wrap the
>> inline objects like __OBJ_PATH__ in quotes. It is either-or. In
>> this case it
>> is probably best to replace inline objects like __OBJ_PATH__ with
>> environmental variable flavors: "$OMC_OBJ_PATH". The latter should
>> give you
>> less escaping-related headaches.
>>
>> The much needed "Young Person's Guide to Escapism in OMC" will be
>> written
>> one day...
>>
>> Hope it helps,
>> Tom
>> Abracode
>>
>> On 6/1/09 6:52 PM, "OnMyCommand discussion" <omc at abracode.com> wrote:
>>
>>> I seem to be having trouble with portions of this script. The path
>>> variable doesn't seem to be excepted by some of the commands...
>>>
>>> Can anyone spot the problem?
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE plist PUBLIC "-//Apple Computer//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>CATEGORIES</key>
>>> <array>
>>> <string>Project</string>
>>> <string>Management</string>
>>> </array>
>>> <key>COMMAND</key>
>>> <array>
>>> <string>action=$(echo -n </string>
>>> <string>__DLG_INPUT_TEXT__</string>
>>> <string> | cut -c 1-3)
>>> path=$(echo -n </string>
>>> <string>__DLG_INPUT_TEXT__</string>
>>> <string> | sed 's/^.\{4\}//g')
>>>
>>> if [ $action = opn ] ; then
>>> open $path
>>>
>>> elif [ $action = mov ] ; then
>>> cd "</string>
>>> <string>__OBJ_COMMON_PARENT_PATH__</string>
>>> <string>"; mv -n "</string>
>>> <string>__OBJ_PATH__</string>
>>> <string>" $path/</string>
>>> <string>__OBJ_NAME__</string>
>>> <string>
>>>
>>> elif [ $action = bak ] ; then
>>> hdiutil create -srcfolder $path -format UDZO -imagekey zlib- 
>>> level=9 -
>>> volname SP '/Users/username/Desktop/Backup'; say Image Creation
>>> Complete; exit
>>>
>>> elif [ $action = pst ] ; then
>>> echo -n $path | pbcopy
>>>
>>> fi</string>
>>> </array>
>>> <key>ESCAPE_SPECIAL_CHARS</key>
>>> <string>esc_with_backslash</string>
>>> <key>EXECUTION_MODE</key>
>>> <string>exe_shell_script</string>
>>> <key>INPUT_DIALOG</key>
>>> <dict>
>>> <key>DEFAULT</key>
>>> <string>Email</string>
>>> <key>INPUT_MENU</key>
>>> <array>
>>> <dict>
>>> <key>NAME</key>
>>> <string>Text to Pasteboard</string>
>>> <key>VALUE</key>
>>> <string>pst test at gmail.com</string>
>>> </dict>
>>> <dict>
>>> <key>NAME</key>
>>> <string>Open File</string>
>>> <key>VALUE</key>
>>> <string>opn '/Users/username/Desktop/filex.txt'</string>
>>> </dict>
>>> <dict>
>>> <key>NAME</key>
>>> <string>Move File</string>
>>> <key>VALUE</key>
>>> <string>mov '/Users/username/Desktop'</string>
>>> </dict>
>>> <dict>
>>> <key>NAME</key>
>>> <string>Backup File</string>
>>> <key>VALUE</key>
>>> <string>bak '/Users/michaelannino/Documents'</string>
>>> </dict>
>>> </array>
>>> <key>INPUT_TYPE</key>
>>> <string>input_combo_box</string>
>>> <key>MESSAGE</key>
>>> <string>[553] SPORT PILOT (Jun|2009)</string>
>>> </dict>
>>> <key>NAME</key>
>>> <array>
>>> <string>Workflow</string>
>>> </array>
>>> <key>SUBMENU_NAME</key>
>>> <string>Media</string>
>>> <key>VERSION</key>
>>> <integer>2</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
>>
>>
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> OMC mailing list
>> OMC at abracode.com
>> http://abracode.com/mailman/listinfo/omc_abracode.com
>>
>>
>> End of OMC Digest, Vol 43, Issue 3
>> **********************************
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 04 Jun 2009 15:44:09 -0400
> From: OnMyCommand discussion <omc at abracode.com>
> Subject: Re: [OMC] Trouble with a Script... Thanks!
> To: <omc at abracode.com>
> Message-ID: <C64D9C49.10B56%s.newave at gmail.com>
> Content-Type: text/plain;	charset="US-ASCII"
>
> +1 to that. In the meantime does anyone know of a way to emulate a
> Ctrl-click on the selected item using applescript?
>
> thx
>
>
> On 6/4/09 3:29 PM, "OnMyCommand discussion" <omc at abracode.com> wrote:
>
>> Thanks Tom :-)
>>
>> Looking forward to the update to Shortcuts!
>>
>>
>>
>> On Jun 4, 2009, at 1:00 PM, omc-request at abracode.com wrote:
>>
>>> Send OMC mailing list submissions to
>>> omc at abracode.com
>>>
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>> http://abracode.com/mailman/listinfo/omc_abracode.com
>>> or, via email, send a message with subject or body 'help' to
>>> omc-request at abracode.com
>>>
>>> You can reach the person managing the list at
>>> omc-owner at abracode.com
>>>
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of OMC digest..."
>>>
>>>
>>> Today's Topics:
>>>
>>>    1. Re: Trouble with a Script... (OnMyCommand discussion)
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> --
>>>
>>> Message: 1
>>> Date: Wed, 03 Jun 2009 14:01:02 -0700
>>> From: OnMyCommand discussion <omc at abracode.com>
>>> Subject: Re: [OMC] Trouble with a Script...
>>> To: <omc at abracode.com>
>>> Message-ID: <C64C329E.65739%tom-old at abracode.com>
>>> Content-Type: text/plain; charset="US-ASCII"
>>>
>>> I did not try to run this command but just looking at it, it seems
>>> you have
>>> escaping problems:
>>> 1. when using $path put it in quotes: "$path"
>>> 2. you set ESCAPE_SPECIAL_CHARS to esc_with_backslash and yet you
>>> wrap the
>>> inline objects like __OBJ_PATH__ in quotes. It is either-or. In
>>> this case it
>>> is probably best to replace inline objects like __OBJ_PATH__ with
>>> environmental variable flavors: "$OMC_OBJ_PATH". The latter should
>>> give you
>>> less escaping-related headaches.
>>>
>>> The much needed "Young Person's Guide to Escapism in OMC" will be
>>> written
>>> one day...
>>>
>>> Hope it helps,
>>> Tom
>>> Abracode
>>>
>>> On 6/1/09 6:52 PM, "OnMyCommand discussion" <omc at abracode.com>  
>>> wrote:
>>>
>>>> I seem to be having trouble with portions of this script. The path
>>>> variable doesn't seem to be excepted by some of the commands...
>>>>
>>>> Can anyone spot the problem?
>>>>
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!DOCTYPE plist PUBLIC "-//Apple Computer//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>CATEGORIES</key>
>>>> <array>
>>>> <string>Project</string>
>>>> <string>Management</string>
>>>> </array>
>>>> <key>COMMAND</key>
>>>> <array>
>>>> <string>action=$(echo -n </string>
>>>> <string>__DLG_INPUT_TEXT__</string>
>>>> <string> | cut -c 1-3)
>>>> path=$(echo -n </string>
>>>> <string>__DLG_INPUT_TEXT__</string>
>>>> <string> | sed 's/^.\{4\}//g')
>>>>
>>>> if [ $action = opn ] ; then
>>>> open $path
>>>>
>>>> elif [ $action = mov ] ; then
>>>> cd "</string>
>>>> <string>__OBJ_COMMON_PARENT_PATH__</string>
>>>> <string>"; mv -n "</string>
>>>> <string>__OBJ_PATH__</string>
>>>> <string>" $path/</string>
>>>> <string>__OBJ_NAME__</string>
>>>> <string>
>>>>
>>>> elif [ $action = bak ] ; then
>>>> hdiutil create -srcfolder $path -format UDZO -imagekey zlib- 
>>>> level=9 -
>>>> volname SP '/Users/username/Desktop/Backup'; say Image Creation
>>>> Complete; exit
>>>>
>>>> elif [ $action = pst ] ; then
>>>> echo -n $path | pbcopy
>>>>
>>>> fi</string>
>>>> </array>
>>>> <key>ESCAPE_SPECIAL_CHARS</key>
>>>> <string>esc_with_backslash</string>
>>>> <key>EXECUTION_MODE</key>
>>>> <string>exe_shell_script</string>
>>>> <key>INPUT_DIALOG</key>
>>>> <dict>
>>>> <key>DEFAULT</key>
>>>> <string>Email</string>
>>>> <key>INPUT_MENU</key>
>>>> <array>
>>>> <dict>
>>>> <key>NAME</key>
>>>> <string>Text to Pasteboard</string>
>>>> <key>VALUE</key>
>>>> <string>pst test at gmail.com</string>
>>>> </dict>
>>>> <dict>
>>>> <key>NAME</key>
>>>> <string>Open File</string>
>>>> <key>VALUE</key>
>>>> <string>opn '/Users/username/Desktop/filex.txt'</string>
>>>> </dict>
>>>> <dict>
>>>> <key>NAME</key>
>>>> <string>Move File</string>
>>>> <key>VALUE</key>
>>>> <string>mov '/Users/username/Desktop'</string>
>>>> </dict>
>>>> <dict>
>>>> <key>NAME</key>
>>>> <string>Backup File</string>
>>>> <key>VALUE</key>
>>>> <string>bak '/Users/michaelannino/Documents'</string>
>>>> </dict>
>>>> </array>
>>>> <key>INPUT_TYPE</key>
>>>> <string>input_combo_box</string>
>>>> <key>MESSAGE</key>
>>>> <string>[553] SPORT PILOT (Jun|2009)</string>
>>>> </dict>
>>>> <key>NAME</key>
>>>> <array>
>>>> <string>Workflow</string>
>>>> </array>
>>>> <key>SUBMENU_NAME</key>
>>>> <string>Media</string>
>>>> <key>VERSION</key>
>>>> <integer>2</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
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> OMC mailing list
>>> OMC at abracode.com
>>> http://abracode.com/mailman/listinfo/omc_abracode.com
>>>
>>>
>>> End of OMC Digest, Vol 43, Issue 3
>>> **********************************
>>
>>
>> _______________________________________________
>> OMC mailing list
>> OMC at abracode.com
>> http://abracode.com/mailman/listinfo/omc_abracode.com
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> OMC mailing list
> OMC at abracode.com
> http://abracode.com/mailman/listinfo/omc_abracode.com
>
>
> End of OMC Digest, Vol 43, Issue 4
> **********************************




More information about the OMC mailing list