The ampersand ( &) is the concatenation operator, so what we're doing is constructing a command just like the one we'd type in the terminal to launch ds9 with one or more files as arguments. You can tweak the options following the path to ds9 in the above do shell script line to be what you prefer. On run process () end run on open dropped_files process ( dropped_files ) end open on process ( dropped_files ) set file_list to "" if length of dropped_files > 0 then set parent_dir to do shell script "dirname " & quoted form of POSIX path of item 1 of dropped_files else set parent_dir to do shell script "echo $HOME" end if repeat with file_path in dropped_files set file_list to file_list & " " & quoted form of POSIX path of file_path end repeat do shell script "cd " & parent_dir & " /usr/local/bin/ds9 -multiframe -zoom to fit " & file_list & " &> /dev/null &" end process In your /Applications/Utilities folder, there's an app called "Script Editor". Only "applications" can open files in macOS, not dinky little "executables". Verify this works first! That means opening a terminal window and typing ds9 and waiting to make sure XQuartz starts, and the ds9 window opens, and no major errors appear in your terminal window. (The /usr/local/bin folder is hidden in the Finder, but you can type open /usr/local/bin in the terminal to open a window there.) So, if you have an Apple chip, you want to click the link that says something like "X11 Big Sur 11.0 ARM64"-unless there's a newer version for a newer macOS by the time you're reading this.)Įxtract the file, and put the contents (both ds9 and ds9.zip, not any folder they extracted into) into /usr/local/bin. If it says "Apple" next to "Chip", you have ARM64. ARM64? Check the Apple menu at top left, and choose "About This Mac". Go to the ds9 download page and get the appropriate X11-based release for your OS. Get the command-line (X11) version of ds9 This is the hack I came up with to enable that. ![]() Sometimes, though, I want to open a FITS file by double-clicking it in the Finder. So, I stick with the command line version. Now, their "Aqua" builds of ds9 for macOS use the Tcl/Tk framework's implementation of the native macOS widgets (prettier!) and Finder double-click-ability (convenient!) at the cost of convenient command-line launching and, most recently, incompatibility with Dark Mode™ on macOS Monterey (disaster!). SAO distributes X11 builds of DS9 for macOS, which I can launch from the command line, so I use those. (Except, obviously, I have an alias for those options. thing.fits as fast as I can type it is useful to me. I spend most of my time working from the command-line, so being able to inspect an astronomical FITS format image in DS9 with ds9 -multiframe -zoom to fit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |