• 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: Difficulty Opening a Text File in BBEdit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Difficulty Opening a Text File in BBEdit


  • Subject: Re: Difficulty Opening a Text File in BBEdit
  • From: Chris Espinosa <email@hidden>
  • Date: Tue, 27 Aug 2002 11:37:41 -0700

On Tuesday, August 27, 2002, at 11:16 AM, Sean Mills wrote:

set logPath to (path to preferences as string) & "log.txt"

tell application "Finder"
set logCopy to duplicate alias logPath to (path to desktop) replacing
yes
end tell

tell application "BBEdit 6.1"
open logCopy
end tell

The result of the 'duplicate' in the Finder tell block is a Finder object.

You're giving BBEdit's 'open' command a Finder object.

BBEdit doesn't understand Finder objects. Generally, applications don't understand other apps' objects. To tell one app to use an object from another, you have to convert it into an AppleScript object, in this case an alias:
First, try:

tell application "Finder"
set logCopy to (duplicate alias logPath to (path to desktop) replacing
yes) as alias
end tell

tell application "BBEdit 6.1"
open logCopy
end tell


Or you could just ask the Finder to open the file with the specific application:


tell application "Finder"
set logCopy to (duplicate alias logPath to (path to desktop) replacing
yes) as alias
open logCopy using application file id "R*ch"
end tell

Chris
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Difficulty Opening a Text File in BBEdit (From: Sean Mills <email@hidden>)

  • Prev by Date: Re: Migrating from Claris Emailer to Mail
  • Next by Date: Re: Moving (to) Mail....
  • Previous by thread: Difficulty Opening a Text File in BBEdit
  • Next by thread: Re: Difficulty Opening a Text File in BBEdit
  • Index(es):
    • Date
    • Thread