Hi Chris, If you are using a script in terminal and you have a folder's window open, you could drag the name of the folder to the "terminal" to complete it. I don't know if you can do that when AppleScript asks for the folder's name.
Sorry to insist, but with Default Folder you could use any open window in Finder just pointing to it with the cursor, or a recent folder, or... Best, Nestor #---------------------------------------------- > On 11 Apr 2019, at 18:37, Christopher Stone <[email protected]> > wrote: > > On 04/11/2019, at 03:48, Scott in Pollock <[email protected]> wrote: >> I often need to create a new text file and save it to a directory deep down >> within ~/Library. Is there a way I can automate either the save to that >> folder, OR the navigation to that folder during a save (short of putting >> that folder in Finder Favorites)? > > Hey Scott, > > The easiest way to do this on a regular basis is with an AppleScript in > BBEdit's Script Menu bound to a keyboard shortcut. > > ------------------------------------------------------------ > # Auth: Christopher Stone > # dCre: 2019/04/11 16:30 > # dMod: 2019/04/11 16:30 > # Appl: BBEdit, System Events > # Task: Save Front BBEdit Document to Deeply Nested Folder. > # Libs: None > # Osax: None > # Tags: @Applescript, @Script, @BBEdit, @System_Events, @Save, @Document, > @Deeply, @Nested, @Folder > ------------------------------------------------------------ > > set deepDir to > "~/test_directory/BBEdit_Test_Dir_Level_01/BBEdit_Test_Dir_Level_02" > tell application "System Events" to set deepDir to POSIX path of (get disk > item deepDir) > > set docName to text returned of (display dialog "Enter Name of Document to be > Saved:" default answer "Temp.txt") > > tell application "BBEdit" > tell front document > if on disk = false then > save it to (deepDir & "/" & docName) > end if > end tell > end tell > > ------------------------------------------------------------ > > You'll need to change the path in the variable deepDir to suit. > > When you run the script it'll ask you for a file name, and then it'll save it > to the defined location. > > Many customizations are possible. > > -- > Best Regards, > Chris > > > -- > This is the BBEdit Talk public discussion group. If you have a > feature request or need technical support, please email > "[email protected]" rather than posting to the group. > Follow @bbedit on Twitter: <https://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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/bbedit. -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <https://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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
