


Tell application id "" to activateĭo shell script shellCMD & thisItem's quoted form Set thisItem to the POSIX path of the contents of thisItem Set selectedItems to selection as alias list After dealing with the Security & Privacy related prompts one can then use the keyboard shortcut.Įxample AppleScript code: set selectedItems to Open in Calc, or it is available on the context menu, right-click the file and select it from Quick Actions or Services. Note: The first time using the Service/Quick Action I recommend not use the keyboard shortcut and after selecting the target file in Finder, then either from Finder > Services click e.g.Then assign it a keyboard shortcut in System Preferences > Keyboard > Shortcuts > Services, e.g.: ⌃⌥⌘O Save the Quick Action as e.g.: Open in Calc
#Libreoffice macos big sur code
In Automator, create a new Quick Action, as shown in the screen shot below the Notes: section, with the following settings: Workflow receives in Īdd a Run AppleScript action, replacing the default code with the example AppleScript code, show below. The following example AppleScript code, shown below, can be used in various ways, however, this will focus on creating an Automator Service/Quick Action and also assigning it a keyboard shortcut. If one is already in Finder then this certainly is much quicker and easier then going thru the application to open the file. As that is not doable by the methods previously mentioned, an alternative is to select the file in Finder and either select a Service/Quick Action or press a keyboard shortcut and have the selected file open in the given application. In your particular use case, the only practical reason to associate a give file extension with a given application is to be able to either double-click the file or press ⌘O in Finder and have it open in it. As such, there is no default method thru Finder, Get Info and or Open With in macOS to associate a particular file extension with Calc, as it is just not a fully functional standalone application as with the aforementioned applications. Calc is not a separate standalone application as in what Excel is in Microsoft Office or like Numbers, which are fully functional standalone applications.
