Re: Simple AS question (BBEdit)
Re: Simple AS question (BBEdit)
- Subject: Re: Simple AS question (BBEdit)
- From: Chris Goedde <email@hidden>
- Date: Thu, 5 Feb 2009 13:20:46 -0600
I appreciate the two responses so far, but they don't quite address
the issue I'm concerned about. I realize that I can work with the text
of the document; what I'm more worried about is the reference to the
document itself. Here's a slight variation of my original script:
set thePath to (path to desktop as string)
set theOffset to offset of "Desktop" in thePath
set thePath to (text 1 through (theOffset - 1) of thePath)
set thePath to thePath & "Documents:Work:Professional:STEP:Web
Site:Development:"
tell application "BBEdit"
set indexFile to thePath & "index.html"
open indexFile
set indexDoc to text document "index.html"
set indexText1 to text of indexDoc
set footerFile to thePath & "footer.shtml"
open footerFile
set indexText2 to text of indexDoc
end tell
This opens a file, sets a reference to the corresponding document and
grabs the text from that document. (And this works, indexText1 has the
text from index.html.) The script then opens a second file. After that
it tries to regrab the text from the original document. But now
indexDoc is actually a reference to a different document, and
indexText2 actually holds the text from footer.shtml. It seems that
indexDoc is referencing a different document before and after the
second file is opened.
That's what I'm worried about---that the document references are
fragile. (At least that's how I interpret what I'm seeing.) Is there a
way for me to get a non-fragile reference to each document that won't
change as I open and close files?
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden