 |
 |
Commandline tool or method for generating clipping files?
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
Does anyone know of a commandline tool or method for generating clipping files. I ran across this one for creating url clippings ( http://derailer.org/iloc/), but nothing on text or image clippings. I know the information is stored in the resource fork, but is it encoded?
Anyone have a shell script to pipe the clipboard into a clipping file?
Thanks
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Oct 2001
Location: San Jose, CA
Status:
Offline
|
|
Can't you just do drag and drop?
Or are you trying to script this with other actions?
Steve
|
|
Celebrating 10 years and 4000 posts on MacNN!
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Online
|
|
This would be an Applescript thing, a shell script knows nothing about the GUI environment, including your clipboard contents.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
I'm looking to do this in a shell script. This is definitely a shell script thing rather than Applescript. The shell script knows quit a bit about the clipboard and forget the GUI...
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Online
|
|
Are you sure about that? There might be some sort of OS X binary you can invoke to paste from the clipboard from within your script, but the bash/tcsh/sh/etc. shell script language itself knows nothing about the GUI environment it runs in - it is platform agnostic.
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: May 2001
Location: Hilbert space
Status:
Offline
|
|
You don't need a GUI to run an AppleScript. And besides, to my knowledge (without combining it with an AppleScript), I'm fairly certain you cannot access the clipboard with a shell script.
|
|
I don't suffer from insanity, I enjoy every minute of it.
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2000
Location: Nashua NH, USA
Status:
Offline
|
|
Don't forget you can run applescripts from the command line.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by OreoCookie
And besides, to my knowledge (without combining it with an AppleScript), I'm fairly certain you cannot access the clipboard with a shell script.
You can access the clipboard with the pbcopy and pbpaste tools. For example, printf "Whoa" | pbcopy will copy "Whoa" to the clipboard, and pbpaste | wc will do a word count on the contents of the clipboard.
I'm not aware of any way to make a clipping, though.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Online
|
|
Don't know why you'd need a clipping, you could always do a pbpaste > /your/file.txt and get something you could easily Quickview. Then again, the original poster hasn't really shared much in terms of what exactly he's/she's trying to accomplish, so I don't even know if this would be a viable alternative.
|
|
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
Originally Posted by besson3c
Don't know why you'd need a clipping, you could always do a pbpaste > /your/file.txt and get something you could easily Quickview.
Indeed. It is utterly obnoxious that text clippings can't be viewed via QuickLook.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Online
|
|
Yeah, QuickLook not Quickview... sorry!
I wouldn't be surprised if text clippings are just text files with a certain file extension and Apple has built something into the OS to support them for legacy purposes. I never did see the point of text clippings anyway.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status:
Offline
|
|
The advantage of clippings is that they can hold multiple flavours of the data and just like with the pasteboard or drag & drop the receiving application can pick the best flavour when receiving (Photoshop might pick PICT-data, BBEdit text-data).
Sometimes this is immensely useful, sometimes it's not what you want.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally Posted by besson3c
I wouldn't be surprised if text clippings are just text files with a certain file extension and Apple has built something into the OS to support them for legacy purposes.
I think you'll find that's not the case if you open one in TextEdit.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: May 2001
Location: Hilbert space
Status:
Offline
|
|
Originally Posted by Chuckit
You can access the clipboard with the pbcopy and pbpaste tools. For example, printf "Whoa" | pbcopy will copy "Whoa" to the clipboard, and pbpaste | wc will do a word count on the contents of the clipboard.
Cool, didn't know that, learnt something today. I can't seem to paste anything other than text, though.
|
|
I don't suffer from insanity, I enjoy every minute of it.
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Yeah, they can only work with text, RTF and EPS.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|