Re: Difficulty Opening a Text File in BBEdit
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.