• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Martin's Package-Opening Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Martin's Package-Opening Script


  • Subject: Martin's Package-Opening Script
  • From: "Jonathan Levi, M.D." <email@hidden>
  • Date: Tue, 31 May 2005 09:11:36 -0400

It's very nice -- opens packages of type .mbox, .bundle, .pkg -- in short, probably any package file with a suffix.

Except for application packages -- not the original subject, admittedly, but why not include them, too? But a slight modification of Martin's script solves this:

set foo to choose file
tell application "Finder"
	--following string conversion could also be to Unicode text
	if (foo as string) ends with ".app:" then
		open alias ((foo as string) & "Contents:")
	else
		set bar to name of foo
		set myName to my killExt(bar)
		set name of foo to myName
		open foo
		set name of foo to bar
	end if
end tell

on killExt(x)
	set oldDelims to AppleScript's text item delimiters
	set AppleScript's text item delimiters to "."
	return word 1 of x
	set AppleScript's text item delimiters to oldDelims
end killExt

It still doesn't work with .nib packages, because because choose file stops at the nib's application. Perhaps the "default location" option of choose file may help

Jonathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Martin's Package-Opening Script
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Getting out of a infinite loop when using system events
  • Next by Date: <no subject>
  • Previous by thread: Re : Timeout on panther
  • Next by thread: Re: Martin's Package-Opening Script
  • Index(es):
    • Date
    • Thread