January 25, 2025
Description
This script provides a convenient way to select a slicer when opening your .3mf or .STL files on macOS. Instead of manually opening each slicer application, this script lets you choose the slicer you want to use directly.
https://github.com/kilinccagatay/SlicerSelector
Feel free to modify the slicer sorting or the default slicer in the code to fit your needs.
Important: This is a script, and every character matters. Even a missing comma or quotation mark can break the code. Please double-check for accuracy when making changes.
You can check my YouTube video to see how it works
on open (theFiles)
set slicerList to {"BambuStudio", "Creality Print", "OrcaSlicer", "PrusaSlicer"}
set chosenSlicer to choose from list slicerList with prompt "Select a slicer to open the 3MF file:" default items {"BambuStudio"}
if chosenSlicer is false then
else
set chosenSlicer to item 1 of chosenSlicer
set slicerPaths to {¬
{"OrcaSlicer", "/Applications/OrcaSlicer.app"}, ¬
{"PrusaSlicer", "/Applications/Original Prusa Drivers/PrusaSlicer.app"}, ¬
{"BambuStudio", "/Applications/BambuStudio.app"}, ¬
{"Creality Print", "/Applications/Creality Print.app"}}
-- Find the path of the chosen slicer
set slicerApp to ""
repeat with slicer in slicerPaths
if item 1 of slicer is chosenSlicer then
set slicerApp to item 2 of slicer
exit repeat
end if
end repeat
if slicerApp is not "" then
repeat with fileToOpen in theFiles
do shell script "open -a " & quoted form of slicerApp & " " & quoted form of POSIX path of fileToOpen
end repeat
else
display dialog "No matching slicer found." buttons {"OK"}
end if
end if
end open
License:
Creative Commons — Attribution — Noncommercial — NoDerivatives
9