I asked:

A simple AppleScript script with a keyboard shortcut would do it,
but where do you want to save the file——in the .projectd or > >
elsewhere?

On 23/5/13 at 16:18, jer...@cowgar.com (Jeremy Cowgar) wrote:

When using the content menu on a given directory, it defaults to the
selected directory. If a keyboard shortcut existed, I would think it
would default to the project directory. If I wanted to place the file
in a sub-directory of the project, I could navigate there.

The reason I asked is that a .projectd file can take files or folders from anywhere. If all your files are in the same directory as the .projectd file then you can save this script in your Scripts folder and assign a keyboard shortcut to it. This, I think, will do what you want. If you want files, folders or URIs from elsewhere added then the script can be modified accordingly.

tell application "BBEdit" to tell the front project document
  set _pd1 to its file
  set AppleScript's text item delimiters to ":"
  set _folder to POSIX path of ¬
    ("" & text items 1 through -3 of (_pd1 as string))
  tell me to set _dd to ¬
    display dialog "Name your file:" default answer "filename.txt"
  set _filename to (text returned of _dd)
  set _posix_path to _folder & "/" & _filename
  do shell script ">" & quoted form of _posix_path
  make new project item with properties {file:POSIX file _posix_path}
end tell

-- JD

--
This is the BBEdit Talk public discussion group. 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.
To post to this group, send email to bbedit@googlegroups.com.


Reply via email to