• 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
Re: AppleScript to open a file using the NSObject method - (BOOL)application: openFile:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript to open a file using the NSObject method - (BOOL)application: openFile:


  • Subject: Re: AppleScript to open a file using the NSObject method - (BOOL)application: openFile:
  • From: Charles Srstka <email@hidden>
  • Date: Thu, 9 Dec 2004 23:59:50 -0600

On Dec 9, 2004, at 10:43 AM, daniel wrote:

But as soon as you compile the script in Script Editor, it will replace it with an HFS-style path.

Yeah, why does it do this, anyway? It's really annoying when you want to make a script that will work on more than one machine. Sometimes you just want to deal with /tmp or /Applications or whatever, and don't care what the name of the boot disk is.


But anyway, here's a way to work around it:

set posixPath to "/Users/stephenmcintosh/Pictures/100_0590.JPG"
set theFile to POSIX file thePosixPath

tell application "Finder"
	open theFile
end tell

Charles

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


References: 
 >AppleScript to open a file using the NSObject method - (BOOL)application: openFile: (From: Stephen J McIntosh <email@hidden>)
 >Re: AppleScript to open a file using the NSObject method - (BOOL)application: openFile: (From: "M. Uli Kusterer" <email@hidden>)
 >Re: AppleScript to open a file using the NSObject method - (BOOL)application: openFile: (From: daniel <email@hidden>)

  • Prev by Date: Re: Crazy Behind the Scenes Hard-wiring in AppKit?
  • Next by Date: sound and attributedString
  • Previous by thread: Re: AppleScript to open a file using the NSObject method - (BOOL)application: openFile:
  • Next by thread: Printed Reports
  • Index(es):
    • Date
    • Thread