 |
 |
iKey and Unix commands
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status:
Offline
|
|
I'd posted this to the software forum but didn't get a response. I'm trying out iKey as it seems like a great way to combine scripts written in Python or Perl with macros. Sort of like what you can do with Services, only in a more robust fashion.
However...
OK, I've been trying to figure this out and I can't. I have a python script in ~/bin which does a bit of reformatting of text in the clipboard so I can paste it into a mail message. (Basically a fancy formatter)
I created a Unix shortcut in iKey so I could associate this with a key. The shortcut is as follows:
pbpaste | /Users/clarkgoble/bin/format_paragraph 2 55 "|" | pbcopy
Now in iKey this does nothing to the clipboard. But if I do this as a line in Terminal then it works fine, converting the clipboard.
Any ideas of what might be happening? I've tried putting full paths to pbpaste but to no avail.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Oct 2000
Location: Midwest
Status:
Offline
|
|
Weeelllll.......
If you run it in the Terminal you are using a shell to communicate. If you run it as an iKey where are you sending it? What is going to be the vehicle for interaction? I'm scratching my head, maybe I don't understand the question.
There is an option in iKey's Unix group to Run in Terminal, but I am guessing that you saw that and it does not fit your need.
Craig
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status:
Offline
|
|
I saw that, tried that, and it doesn't work.
The basic problem is that if that line is run, in any fashion, by iKey, it doesn't work. If I manually run it in the shell, it does.
At first I thought it might be that my .tcshrc isn't being run and paths aren't right. But I put explicit paths everywhere. I just don't know why iKey isn't running it. It is very confusing to me.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Location: Adelaide, South Australia
Status:
Offline
|
|
While I've never upgraded to iKey I do still have "Youpi Key" lying around fallow. I made a new item of type "run unix commands" and entered the following command:
/usr/bin/pbpaste | /usr/bin/fmt | /usr/bin/pbcopy
Worked exactly as it should: reformatted the text in the clipboard and then pasted it back there. So I think you can narrow it down to your python script (assuming that the above also works in iKey).
Cheers,
Paul
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status:
Offline
|
|
I played around with it more and it appears like iKey does not like arguments passed to the script. I don't know why.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
Did you try
sh -c '/usr/bin/pbpaste | /Users/clarkgoble/bin/format_paragraph 2 55 "|" | /usr/bin/pbcopy'
perhaps it's doing an exec rather than a system() ?
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|