An OS X app to extract pets

Puppy related raves and general interest that doesn't fit anywhere else
Post Reply
Message
Author
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

An OS X app to extract pets

#1 Post by mavrothal »

I'm using Macs quite often :oops: (OK, is not Linux but is BSD 8) ) and some times I want to extract a pet to look at it, usually through the terminal tar command.
That's too much for a mac user ( :P ) so I made a tittle "pet_extractor" app to do that. Attached below (for other the "macpy" hybrids around here :lol: )

If you rather make your own app, open "Script Editor", paste this script:

Code: Select all

tell application "Finder" to set theSel to selection as text
if theSel is "" then display dialog "Nothing selected" buttons {"Cancel"} default button 1
open theSel

on open theSel
	set thePet to POSIX path of theSel
	set theFol to POSIX path of (do shell script "dirname " & thePet)
	set isPet to (do shell script "echo " & thePet & "|rev|cut -c 1-3|rev")
	if isPet is not "pet" then display dialog "This is not a pet file" buttons {"Cancel"} default button 1
	do shell script "tar -xf " & thePet & " -C " & theFol
end open
and "File -> Export..." it as an application.
Put it in your applications folder and instruct the OS to use it (from the "Get Info -> Open with:" of a pet file )
Attachments
pet_extractor.zip
OS X app to extract pets. NOT for puppylinux
(59.71 KiB) Downloaded 120 times
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

Post Reply