{"id":1014,"date":"2005-04-28T13:57:23","date_gmt":"2005-04-28T18:57:23","guid":{"rendered":"\/?p=1014"},"modified":"2005-04-28T14:00:47","modified_gmt":"2005-04-28T19:00:47","slug":"bbedit-disk-browser-and-terminal-scripts","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2005\/04\/28\/bbedit-disk-browser-and-terminal-scripts\/","title":{"rendered":"BBEdit Disk Browser and Terminal Scripts"},"content":{"rendered":"<p>\r\nIn the <a href=\"http:\/\/mjtsai.com\/blog\/2005\/04\/28\/bbedit-82\/\">previous post<\/a>, I mentioned BBEdit&rsquo;s disk browsers. These are one of my favorite features, but many BBEdit users don&rsquo;t seem to use them. This is how I use them. Much of what I do revolves around three basic activities:\r\n<\/p>\r\n\r\n<ul>\r\n<li>\r\nFinding a file to work on.\r\n<\/li>\r\n<li>\r\nViewing or editing the file, usually in BBEdit, Interface Builder, Safari, or Photoshop.\r\n<\/li>\r\n<li>\r\nRunning shell commands on the file or its relatives.\r\n<\/li>\r\n<\/ul>\r\n\r\n<p>\r\nIt&rsquo;s essential that I be able to move from one activity to another quickly. Disk browsers combined with some AppleScripts make it convenient for me to use BBEdit as the hub. I can almost everything without using Xcode or the Finder.\r\n<\/p>\r\n\r\n<p>\r\nTo view files, or pick one to work on, I use disk browsers. They&rsquo;re much faster than the Finder (or Path Finder, which I use when I need to move or copy files) to move up and down levels and peek at the contents of files or folders.\r\n<\/p>\r\n\r\n<p>\r\nTo edit a file in a disk browser, I select it (usually by typing the first few letters of its name) and press Return. This opens it for editing in BBEdit. Pressing Option-Return opens it in the default application, instead of BBEdit. Thus, if I have an HTML file I can press Return to edit it, or Option-Return to preview it in Safari. Or, if I have a package, I can press Return to treat it as a folder and view its contents in the disk browser, or Option-Return to open it as a package.\r\n<\/p>\r\n\r\n<p>\r\nWhen I&rsquo;m editing a file, I might want to view its parent folder or one of its siblings. Running <a href=\"http:\/\/c-command.com\/scripts\/bbedit\/disk-browser\">this script<\/a> opens a new disk browser window that makes it easy to do this.\r\n<\/p>\r\n\r\n<p>\r\nOr, I may want to run shell commands on the file that I&rsquo;m editing or on one of its relatives that I&rsquo;m viewing in a disk browser. To do that, I run a script to open a <a href=\"http:\/\/c-command.com\/scripts\/bbedit\/shell-worksheet\">shell worksheet<\/a> or <a href=\"http:\/\/c-command.com\/scripts\/bbedit\/terminal-window\">Terminal window<\/a> with the proper working directory.\r\n<\/p>\r\n\r\n<p>\r\nWhen I&rsquo;m in a shell, I can use the <tt>bbedit<\/tt> tool to get back to an editing window (if I give it a file) or disk browser (if I give it a folder).\r\n<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>In the previous post, I mentioned BBEdit&rsquo;s disk browsers. These are one of my favorite features, but many BBEdit users don&rsquo;t seem to use them. This is how I use them. Much of what I do revolves around three basic activities: Finding a file to work on. Viewing or editing the file, usually in BBEdit, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1014","post","type-post","status-publish","format-standard","hentry","category-technology"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=1014"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1014\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=1014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=1014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=1014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}