Hey Folks,

I vaguely remember some discussion about this but can't seem to find it.

Is there a parameter for a worksheet for its path on disk?  (Not the working 
directory.)

I can certainly do something like this:

#-------------------------------------------------------------------------------------------

wsPATH=`osascript -e '
  tell application "BBEdit"
    set AppleScript'"'"'s text item delimiters to ":"
    return (posix path of (((text items 1 thru -2 of ((file of front document) 
as text)) as text) & ":"))
  end tell
'`;

if [ "$wsPATH" != "/missing value/" ]
  then
    ls -1la@ "$wsPATH";
  else
    echo "Oops!  Somebody save me!";
fi;

#-------------------------------------------------------------------------------------------

But that's far from pretty...

Offloading the script itself to a library is quite a lot cleaner.

#-------------------------------------------------------------------------------------------

wsPATH=`osascript ~/"Library/Application Support/BBEdit/BBEdit_lib/bbLib.scpt" 
"wsPath"`;

if [ "$wsPATH" != "/missing value/" ]
  then
    ls -1la@ "$wsPATH";
  else
    echo "Oops!  Somebody save me!";
fi;

#-------------------------------------------------------------------------------------------

The problem I'm working on at the moment is this:

When I'm testing or learning new things I often duplicate a worksheet to create 
a save-point, so I don't foul up code I've gotten working (and won't remember 
accurately a few hours hence).  I may also alter my data files to fit the 
direction I'm moving.

I get tired of having to reset hard file paths, so I want to be able to make 
them relative to the worksheet.

With what I've got I can auto-set the working directory or just create relative 
paths, but I'm curious to know what other people have done.

--
Best Regards,
Chris

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to