Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Commandline tool or method for generating clipping files?

Commandline tool or method for generating clipping files?
Thread Tools
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 22, 2009, 08:57 AM
 
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
Reply With Quote
Jul 22, 2009, 01:17 PM
 
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
Reply With Quote
Jul 22, 2009, 03:51 PM
 
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
Reply With Quote
Jul 22, 2009, 04:48 PM
 
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
Reply With Quote
Jul 22, 2009, 05:23 PM
 
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
Reply With Quote
Jul 22, 2009, 05:58 PM
 
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
Reply With Quote
Jul 22, 2009, 07:35 PM
 
Don't forget you can run applescripts from the command line.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 22, 2009, 08:03 PM
 
Originally Posted by OreoCookie View Post
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
Reply With Quote
Jul 22, 2009, 08:40 PM
 
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
Reply With Quote
Jul 22, 2009, 08:46 PM
 
Originally Posted by besson3c View Post
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.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Online
Reply With Quote
Jul 22, 2009, 08:51 PM
 
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
Reply With Quote
Jul 23, 2009, 02:13 AM
 
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
Reply With Quote
Jul 23, 2009, 02:28 AM
 
Originally Posted by besson3c View Post
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
Reply With Quote
Jul 23, 2009, 03:47 AM
 
Originally Posted by Chuckit View Post
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
Reply With Quote
Jul 23, 2009, 03:52 AM
 
Yeah, they can only work with text, RTF and EPS.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:38 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2