├── subtitle-edit.png ├── subtitleeditw ├── LICENSE ├── CHANGELOG.md ├── TODO.md ├── PLAN.md ├── README.md ├── install-mac.command └── llms.txt /subtitle-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twardoch/subtitle-edit-mac-wine/HEAD/subtitle-edit.png -------------------------------------------------------------------------------- /subtitleeditw: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script launches Subtitle Edit using Wine. 3 | # Error output (stderr) is intentionally not redirected to /dev/null, 4 | # so users can see any error messages from Wine or Subtitle Edit. 5 | WINEPREFIX=${HOME}/.wine-se/ wine64 "C:/Program Files/Subtitle Edit/SubtitleEdit.exe" "$@" 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | ### Added 10 | - `PLAN.md` for detailing the streamlining process. 11 | - `TODO.md` for a checklist of tasks. 12 | - `CHANGELOG.md` to track changes. 13 | 14 | ### Changed 15 | - Modified `install-mac.command` to: 16 | - Check for existing Homebrew installation. 17 | - Use a temporary directory for downloads and ensure cleanup. 18 | - Add `set -e` for better error handling. 19 | - Improve user prompts and feedback with more `echo` statements. 20 | - Check for write permissions to `/usr/local/bin` and provide guidance if sudo is needed. 21 | - Include a comment regarding the choice of `wine-crossover`. 22 | - Update Homebrew installation command to the current recommended one. 23 | - Add PATH export for Homebrew in current session after installation. 24 | - Ensure WINEPREFIX directory is created. 25 | - Add `-o` to unzip to overwrite existing files if any. 26 | - Modified `subtitleeditw` to: 27 | - Remove redirection of stderr to `/dev/null`, allowing errors to be visible. 28 | - Add a comment explaining the change. 29 | - Updated `README.md` to: 30 | - Reflect changes in `install-mac.command` (Homebrew check, prompts, temp file handling, permissions). 31 | - Add a note about `wine-crossover` usage. 32 | - Mention that error output from `subtitleeditw` is now visible. 33 | - Improve overall clarity and structure of installation and usage instructions. 34 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | - [x] **Project Setup & Initial File Creation:** 2 | - [x] Create `PLAN.md` with the detailed plan. 3 | - [x] Create `TODO.md` with a checklist version of the plan. 4 | - [x] Create `CHANGELOG.md` to track modifications. 5 | 6 | - [x] **Analyze `install-mac.command` for Streamlining:** 7 | - [x] **Homebrew Installation:** 8 | - [x] Modify the script to check if Homebrew is already installed. 9 | - [x] If not installed, proceed with installation. 10 | - [x] If installed, inform the user and skip Homebrew installation. 11 | - [x] **Wine Version (`wine-crossover` vs. standard Wine):** 12 | - [x] For the MVP, retain the use of `gcenx/wine` and `wine-crossover`. 13 | - [x] Add a comment in the script and `PLAN.md` noting this as a potential area for future investigation. 14 | - [x] **Tesseract Installation:** 15 | - [x] Keep Tesseract installation. 16 | - [x] **Temporary Download Location:** 17 | - [x] Modify script to download `se.zip` to a temporary directory. 18 | - [x] Ensure temporary directory is cleaned up. 19 | - [x] **Error Handling & Verbosity:** 20 | - [x] Add `set -e` to the script. 21 | - [x] Add more `echo` statements for user feedback. 22 | - [x] **Permissions for `/usr/local/bin`:** 23 | - [x] Check if `/usr/local/bin` is writable. 24 | - [x] Provide instructions if `sudo` is needed for `cp`. 25 | - [x] **Clarity of Prompts:** 26 | - [x] Ensure Subtitle Edit ZIP URL prompt is clear. 27 | 28 | - [x] **Analyze `subtitleeditw` Script:** 29 | - [x] **Error Redirection (`2>/dev/null`):** 30 | - [x] Remove `2>/dev/null`. 31 | - [x] **Integration vs. Separate File:** 32 | - [x] Keep as a separate file. 33 | 34 | - [x] **Update `README.md`:** 35 | - [x] Reflect changes in `install-mac.command`. 36 | - [x] Clarify Homebrew installation check. 37 | - [x] Add note about `wine-crossover`. 38 | - [x] Ensure GUI/CLI instructions are accurate. 39 | - [x] Mention visibility of error output. 40 | 41 | - [x] **Testing (Conceptual):** 42 | - [x] Mentally walk through script logic and README. 43 | 44 | - [x] **Final Review and Cleanup:** 45 | - [x] Review all modified files. 46 | - [x] Update `PLAN.md` and `TODO.md`. 47 | - [x] Update `CHANGELOG.md`. 48 | 49 | - [ ] **Submit Changes:** 50 | - [ ] Commit changes with a clear message. 51 | - [ ] Use a descriptive branch name. 52 | -------------------------------------------------------------------------------- /PLAN.md: -------------------------------------------------------------------------------- 1 | 1. **Project Setup & Initial File Creation:** 2 | * Create `PLAN.md` with the detailed plan (this document). 3 | * Create `TODO.md` with a checklist version of the plan. 4 | * Create `CHANGELOG.md` to track modifications. 5 | 6 | 2. **Analyze `install-mac.command` for Streamlining:** 7 | * **Homebrew Installation:** 8 | * Modify the script to check if Homebrew is already installed. 9 | * If not installed, proceed with installation. 10 | * If installed, inform the user and skip Homebrew installation. 11 | * **Wine Version (`wine-crossover` vs. standard Wine):** 12 | * For the MVP, retain the use of `gcenx/wine` and `wine-crossover` due to the assumption that it was chosen for compatibility reasons that are hard to verify without extensive testing. Add a comment in the script and `PLAN.md` noting this as a potential area for future investigation. 13 | * **Tesseract Installation:** 14 | * Keep Tesseract installation as it seems important for OCR features, which are core to subtitle editing. 15 | * **Temporary Download Location:** 16 | * Modify the script to download `se.zip` to a temporary directory (e.g., using `mktemp -d`) instead of the script's current directory. 17 | * Ensure this temporary directory is cleaned up after extraction. 18 | * **Error Handling & Verbosity:** 19 | * Review existing commands for basic error checking (e.g., `set -e` at the beginning of the script). 20 | * Add more `echo` statements to inform the user about the current stage of the installation. 21 | * **Permissions for `/usr/local/bin`:** 22 | * Before attempting to copy `subtitleeditw` to `/usr/local/bin`, check if the directory is writable. 23 | * If not, inform the user they might need to run that specific `cp` command with `sudo` or create the path and set permissions. Provide clear instructions. 24 | * **Clarity of Prompts:** 25 | * Ensure the prompt for the Subtitle Edit ZIP URL is very clear. 26 | 27 | 3. **Analyze `subtitleeditw` Script:** 28 | * **Error Redirection (`2>/dev/null`):** 29 | * Remove `2>/dev/null` to allow users to see potential error messages from Wine or Subtitle Edit. This is more helpful for troubleshooting. 30 | * Alternatively, make verbose output an option (e.g., if a `-v` flag is passed to `subtitleeditw`), but for MVP, simply removing redirection is simpler and safer. 31 | * **Integration vs. Separate File:** 32 | * For MVP, keep it as a separate file copied to `/usr/local/bin` as this is user-friendly for launching the application. 33 | 34 | 4. **Update `README.md`:** 35 | * Reflect any changes made to the installation process in `install-mac.command`. 36 | * Clarify the Homebrew installation step (i.e., that the script checks for it). 37 | * Add a note about why `wine-crossover` is used (pending further investigation for alternatives). 38 | * Ensure instructions for running the GUI and CLI versions are still accurate. 39 | * Mention that error output from Wine/Subtitle Edit will now be visible if `2>/dev/null` is removed from `subtitleeditw`. 40 | 41 | 5. **Testing (Conceptual):** 42 | * Since I can't run macOS GUIs or Wine, I will mentally walk through the script logic and README instructions to ensure they are coherent and address the planned changes. 43 | * Emphasis will be on script robustness (e.g., checking for existing Homebrew, handling temporary files). 44 | 45 | 6. **Final Review and Cleanup:** 46 | * Review all modified files for clarity, correctness, and completeness. 47 | * Ensure `PLAN.md` and `TODO.md` are updated to reflect the final state of work. 48 | * Ensure `CHANGELOG.md` lists all significant changes. 49 | 50 | 7. **Submit Changes:** 51 | * Commit all changes with a clear commit message. 52 | * Use a descriptive branch name. 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Subtitle Edit on macOS using Wine 2 | 3 | This project provides a script to install and run [Subtitle Edit](https://github.com/SubtitleEdit/subtitleedit/) on macOS (tested on 10.12 and later, but may work on other versions) using Wine. 4 | 5 | ![](./subtitle-edit.png) 6 | 7 | ## Installation 8 | 9 | 1. **Download this Repository:** 10 | * Download the [latest release of this project](https://github.com/twardoch/subtitle-edit-mac-wine/archive/refs/heads/main.zip) and unzip it. 11 | * Alternatively, clone this repository. 12 | 13 | 2. **Run the Installation Script:** 14 | * Open Terminal.app, navigate to the directory where you unzipped/cloned this project. 15 | * Make the script executable: `chmod +x install-mac.command` 16 | * Run the script: `./install-mac.command` 17 | * If you encounter issues running it directly, you might need to Ctrl+click `install-mac.command` in Finder and choose _Open_, then confirm. 18 | 19 | 3. **Follow On-Screen Prompts:** 20 | * The script will ask you to provide a download link for the **portable version** of Subtitle Edit: 21 | 1. Go to the [Subtitle Edit releases page](https://github.com/SubtitleEdit/subtitleedit/releases). 22 | 2. In the "Latest release" section (or your preferred version), find the ZIP file for the **Portable version** (e.g., `SE_4_0_6_portable.zip`). 23 | 3. Right-click on this ZIP file link and choose "Copy Link". 24 | 4. Paste this link into the Terminal when prompted by the script and press Enter. 25 | * The script will then proceed to: 26 | * Check for Homebrew. If not installed, it will install it. 27 | * Install Wine (using `gcenx/wine` for `wine-crossover`), Tesseract (for OCR), and Winetricks. 28 | * Set up a Wine environment (`~/.wine-se/`). 29 | * Install .NET 4.8 and LAV Filters into the Wine environment. 30 | * Download and install Subtitle Edit to the Wine environment. 31 | * Copy the `subtitleeditw` wrapper script to `/usr/local/bin`. If this location is not writable, it will provide instructions for manual installation or using `sudo`. 32 | 33 | 4. **Post-Installation:** 34 | * The script will clean up temporary files. You can remove the downloaded ZIP of this repository and the unzipped/cloned folder if you wish, once the installation is successful and `subtitleeditw` is in your PATH. 35 | 36 | **Note on Wine Version:** This script uses `wine-crossover` from the `gcenx/wine` Homebrew tap. This specific version was likely chosen for better compatibility with Subtitle Edit at the time of the script's creation. Future updates might explore using more standard Wine versions available directly from Homebrew's core tap. 37 | 38 | ## Running Subtitle Edit 39 | 40 | ### GUI Application 41 | 42 | Open a **new** Terminal window/tab (this ensures `/usr/local/bin` is in the PATH if it was just updated) and type: 43 | 44 | ```bash 45 | subtitleeditw 46 | ``` 47 | 48 | This will launch the GUI version of Subtitle Edit. 49 | 50 | **Troubleshooting GUI:** 51 | * **Video Playback:** If you open a video and cannot see it playing, try selecting _Video > Undock video controls_ in Subtitle Edit. 52 | * **Error Messages:** The `subtitleeditw` script no longer suppresses error messages from Wine or Subtitle Edit. If you encounter issues, these messages might provide clues. 53 | 54 | ### Command-Line Interface (CLI) 55 | 56 | Open Terminal.app and type: 57 | 58 | ```bash 59 | subtitleeditw /help 60 | ``` 61 | 62 | This will display the help information for the CLI version of Subtitle Edit. 63 | 64 | #### CLI Example 65 | 66 | Convert all `.srt` subtitles in `INFOLDER` to `.srt` in `OUTFOLDER` and perform some common fixes (replace the `.` in `INFOLDER=` and `OUTFOLDER=` with actual folder paths): 67 | 68 | ```bash 69 | INFOLDER=. && \ 70 | OUTFOLDER=. && \ 71 | mkdir -p "$OUTFOLDER" && \ 72 | subtitleeditw /convert '*.srt' subrip \ 73 | /inputfolder:"$INFOLDER" \ 74 | /outputfolder:"$OUTFOLDER" \ 75 | /overwrite \ 76 | /FixCommonErrors \ 77 | /MergeSameTimeCodes \ 78 | /MergeSameTexts \ 79 | /MergeShortLines \ 80 | /RedoCasing 81 | ``` 82 | 83 | **Note:** Use single quotes to surround `'*.srt'` in the command. 84 | 85 | ## Credits 86 | 87 | - Shell scripts originally by Adam Twardoch, with modifications by the community. 88 | - This project provides a convenient way to use Subtitle Edit on macOS; Subtitle Edit itself is developed by Nikolaj Lynge Olsson and other contributors. 89 | - The scripts in this repository are provided under [The Unlicense](./LICENSE). 90 | - Subtitle Edit is licensed under GPL-3.0. 91 | -------------------------------------------------------------------------------- /install-mac.command: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Get the directory of the script 5 | dir=${0%/*} 6 | if [ "$dir" = "$0" ]; then 7 | dir="." 8 | fi 9 | cd "$dir" 10 | 11 | echo "--- Subtitle Edit for macOS Installer ---" 12 | echo 13 | 14 | # Prompt for Subtitle Edit ZIP URL 15 | echo "This script will guide you through installing Subtitle Edit on macOS using Wine." 16 | echo "Please follow these steps:" 17 | echo "1. Go to the Subtitle Edit releases page: https://github.com/SubtitleEdit/subtitleedit/releases" 18 | echo "2. Find the 'Latest release' section." 19 | echo "3. Right-click on the ZIP file link that includes 'Portable' in its name (e.g., SE3613_portable.zip)." 20 | echo "4. Select 'Copy Link Address'." 21 | echo "5. Paste the copied link here and press Enter:" 22 | read -r SEZIPURL 23 | 24 | if [ -z "$SEZIPURL" ]; then 25 | echo "No URL provided. Exiting." 26 | exit 1 27 | fi 28 | 29 | echo 30 | echo "Thank you! Proceeding with installation..." 31 | echo 32 | 33 | # --- Homebrew Installation --- 34 | echo "[Step 1/5] Checking and installing Homebrew..." 35 | if command -v brew &>/dev/null; then 36 | echo "Homebrew is already installed. Skipping installation." 37 | else 38 | echo "Homebrew not found. Installing Homebrew..." 39 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 40 | # Add Homebrew to PATH for the current script execution 41 | # For Apple Silicon 42 | if [ -d "/opt/homebrew/bin" ]; then 43 | export PATH="/opt/homebrew/bin:$PATH" 44 | fi 45 | # For Intel Macs (usually /usr/local/bin, which should be in PATH already but good to be sure) 46 | if [ -d "/usr/local/bin" ]; then # Redundant on Intel but good practice 47 | export PATH="/usr/local/bin:$PATH" 48 | fi 49 | 50 | echo "Homebrew installation complete." 51 | fi 52 | echo 53 | 54 | # --- Wine and Dependencies Installation --- 55 | echo "[Step 2/5] Installing Wine and other dependencies (Tesseract, Winetricks)..." 56 | # Note: This script uses gcenx/wine and wine-crossover. 57 | # This specific version of Wine was likely chosen for compatibility. 58 | # Future investigation could explore using standard Homebrew wine-stable or wine-devel. 59 | brew tap gcenx/wine 60 | echo "Installing tesseract (for OCR)..." 61 | brew install tesseract 62 | echo "Installing wine-crossover..." 63 | brew install --cask wine-crossover 64 | echo "Installing winetricks..." 65 | brew install winetricks 66 | echo "Wine and dependencies installation complete." 67 | echo 68 | 69 | # --- WINEPREFIX Setup and .NET Installation --- 70 | echo "[Step 3/5] Setting up Wine environment and installing .NET..." 71 | export WINEPREFIX=${HOME}/.wine-se/ 72 | mkdir -p "$WINEPREFIX" # Ensure WINEPREFIX directory exists 73 | 74 | echo "Installing .NET 4.8 (this may take a while)..." 75 | winetricks -q --force dotnet48 76 | echo "Installing LAV Filters..." 77 | winetricks -q --force lavfilters 78 | echo "Setting Wine to Windows 10 mode..." 79 | winetricks -q --force win10 80 | echo ".NET and Wine configuration complete." 81 | echo 82 | 83 | # --- Subtitle Edit Installation --- 84 | echo "[Step 4/5] Downloading and installing Subtitle Edit..." 85 | TMP_DIR=$(mktemp -d) 86 | echo "Created temporary directory: $TMP_DIR" 87 | 88 | # Function to clean up temporary directory on exit 89 | cleanup() { 90 | echo "Cleaning up temporary directory: $TMP_DIR" 91 | rm -rf "$TMP_DIR" 92 | } 93 | trap cleanup EXIT # Register cleanup function to run on script exit (normal or error) 94 | 95 | echo "Downloading Subtitle Edit from $SEZIPURL..." 96 | curl -L -o "$TMP_DIR/se.zip" "$SEZIPURL" 97 | 98 | echo "Extracting Subtitle Edit..." 99 | # Ensure the target directory exists 100 | mkdir -p "$WINEPREFIX/drive_c/Program Files/Subtitle Edit/" 101 | unzip -o "$TMP_DIR/se.zip" -d "$WINEPREFIX/drive_c/Program Files/Subtitle Edit/" # Added -o to overwrite 102 | # No need to rm "$TMP_DIR/se.zip" explicitly, as TMP_DIR will be removed by cleanup 103 | 104 | echo "Subtitle Edit installation complete." 105 | echo 106 | 107 | # --- Install Wrapper Script --- 108 | echo "[Step 5/5] Installing 'subtitleeditw' command..." 109 | SUBTITLEEDITW_SCRIPT_SOURCE="$dir/subtitleeditw" 110 | INSTALL_PATH="/usr/local/bin" 111 | TARGET_SCRIPT_PATH="$INSTALL_PATH/subtitleeditw" 112 | 113 | if [ -w "$INSTALL_PATH" ]; then 114 | cp "$SUBTITLEEDITW_SCRIPT_SOURCE" "$TARGET_SCRIPT_PATH" 115 | chmod +x "$TARGET_SCRIPT_PATH" 116 | echo "'subtitleeditw' command installed to $TARGET_SCRIPT_PATH." 117 | else 118 | echo "Warning: Cannot write to $INSTALL_PATH." 119 | echo "Please copy '$SUBTITLEEDITW_SCRIPT_SOURCE' to a directory in your PATH manually," 120 | echo "or run the following command with sudo:" 121 | echo " sudo cp '$SUBTITLEEDITW_SCRIPT_SOURCE' '$TARGET_SCRIPT_PATH' && sudo chmod +x '$TARGET_SCRIPT_PATH'" 122 | echo 123 | echo "You can also place 'subtitleeditw' in a directory like ~/bin if it's in your PATH." 124 | fi 125 | echo 126 | 127 | echo "--- Installation Finished! ---" 128 | echo 129 | echo "You can now try to run Subtitle Edit by opening a new Terminal window/tab and typing:" 130 | echo " subtitleeditw" 131 | echo 132 | echo "For the command-line version, type:" 133 | echo " subtitleeditw /help" 134 | echo 135 | echo "Note: The first launch of Wine and Subtitle Edit might take some time to configure." 136 | echo "If you encounter issues, ensure all dependencies were installed correctly." 137 | -------------------------------------------------------------------------------- /llms.txt: -------------------------------------------------------------------------------- 1 | This file is a merged representation of the entire codebase, combined into a single document by Repomix. 2 | 3 | 4 | This section contains a summary of this file. 5 | 6 | 7 | This file contains a packed representation of the entire repository's contents. 8 | It is designed to be easily consumable by AI systems for analysis, code review, 9 | or other automated processes. 10 | 11 | 12 | 13 | The content is organized as follows: 14 | 1. This summary section 15 | 2. Repository information 16 | 3. Directory structure 17 | 4. Repository files (if enabled) 18 | 5. Multiple file entries, each consisting of: 19 | - File path as an attribute 20 | - Full contents of the file 21 | 22 | 23 | 24 | - This file should be treated as read-only. Any changes should be made to the 25 | original repository files, not this packed version. 26 | - When processing this file, use the file path to distinguish 27 | between different files in the repository. 28 | - Be aware that this file may contain sensitive information. Handle it with 29 | the same level of security as you would the original repository. 30 | 31 | 32 | 33 | - Some files may have been excluded based on .gitignore rules and Repomix's configuration 34 | - Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files 35 | - Files matching patterns in .gitignore are excluded 36 | - Files matching default ignore patterns are excluded 37 | - Files are sorted by Git change count (files with more changes are at the bottom) 38 | 39 | 40 | 41 | 42 | 43 | install-mac.command 44 | LICENSE 45 | README.md 46 | subtitleeditw 47 | 48 | 49 | 50 | This section contains the contents of the repository's files. 51 | 52 | 53 | #!/usr/bin/env bash 54 | dir=${0%/*} 55 | if [ "$dir" = "$0" ]; then 56 | dir="." 57 | fi 58 | cd "$dir" 59 | 60 | echo "INSTALLING https://github.com/SubtitleEdit/ on macOS" 61 | echo 62 | echo "1. Go to https://github.com/SubtitleEdit/subtitleedit/releases" 63 | echo "2. In 'Latest release', right click the ZIP with 'Portable version' (e.g. 'SE360.zip') and copy link address" 64 | echo "3. Paste it here and press Enter:" 65 | read SEZIPURL 66 | 67 | echo "Thank you, proceeding with installation..." 68 | 69 | # Install Homebrew 70 | 71 | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 72 | 73 | # Install the gcenx/wine build 74 | 75 | brew tap gcenx/wine 76 | brew install tesseract 77 | brew install --cask wine-crossover 78 | brew install winetricks 79 | 80 | export WINEPREFIX=${HOME}/.wine-se/ 81 | 82 | # Install .NET 4.8 83 | 84 | winetricks -q --force dotnet48 85 | winetricks -q --force lavfilters 86 | winetricks -q --force win10 87 | 88 | # Install Subtitle Edit portable 89 | 90 | curl -L -o "$dir/se.zip" "$SEZIPURL" 91 | unzip "$dir/se.zip" -d "$WINEPREFIX/drive_c/Program Files/Subtitle Edit/" 92 | rm "$dir/se.zip" 93 | 94 | cp "$dir/subtitleeditw" "/usr/local/bin" 95 | 96 | echo "Ready! Now open Terminal.app and type" 97 | echo "subtitleeditw" 98 | echo "to run the GUI or" 99 | echo "subtitleeditw /help" 100 | echo "to run the CLI" 101 | 102 | 103 | 104 | This is free and unencumbered software released into the public domain. 105 | 106 | Anyone is free to copy, modify, publish, use, compile, sell, or 107 | distribute this software, either in source code form or as a compiled 108 | binary, for any purpose, commercial or non-commercial, and by any 109 | means. 110 | 111 | In jurisdictions that recognize copyright laws, the author or authors 112 | of this software dedicate any and all copyright interest in the 113 | software to the public domain. We make this dedication for the benefit 114 | of the public at large and to the detriment of our heirs and 115 | successors. We intend this dedication to be an overt act of 116 | relinquishment in perpetuity of all present and future rights to this 117 | software under copyright law. 118 | 119 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 120 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 121 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 122 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 123 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 124 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 125 | OTHER DEALINGS IN THE SOFTWARE. 126 | 127 | For more information, please refer to 128 | 129 | 130 | 131 | # subtitle-edit-mac-wine 132 | 133 | Way to use [Subtitle Edit](https://github.com/SubtitleEdit/subtitleedit/) on macOS 10.12—11. 134 | 135 | ![](./subtitle-edit.png) 136 | 137 | ## Installation 138 | 139 | 1. Download and unzip [this repository](https://github.com/twardoch/subtitle-edit-mac-wine/archive/refs/heads/main.zip) 140 | 2. Ctrl+click `install-mac.command` and choose _Open_. If asked for confirmation, choose _Open_. 141 | 3. When asked, go to the [Subtitle Edit releases page](https://github.com/SubtitleEdit/subtitleedit/releases) 142 | 4. In the _Latest releases_ section, right click the ZIP for the Portable version, for example [`SE360.zip`](https://github.com/SubtitleEdit/subtitleedit/releases/download/3.6.0/SE360.zip) and copy the link 143 | 5. Paste the link to Terminal and press Enter. 144 | 6. Wait until the installation of Homebrew, Wine, winetricks and .NET is completed. 145 | 7. Remove the downloaded ZIP and the unzipped folder. 146 | 147 | ## Running GUI app 148 | 149 | Open Terminal.app and type: 150 | 151 | ``` 152 | subtitleeditw 153 | ``` 154 | 155 | to run the GUI version of Subtitle Edit. _Note: Use _Video > Undock video controls_ if you cannot see the video playing after you open it. 156 | 157 | 158 | ## Using in command-line 159 | 160 | Open Terminal.app and type: 161 | 162 | ``` 163 | subtitleeditw /help 164 | ``` 165 | 166 | to run the CLI version of Subtitle Edit. 167 | 168 | ### Example 169 | 170 | Convert all .srt subtitles in INFOLDER into .srt in the OUTFOLDER and perform some fixes (replace the `.` in `INFOLDER=` and `OUTFOLDER=` with actual folder paths). 171 | 172 | ``` 173 | INFOLDER=. && OUTFOLDER=. && mkdir -p "$OUTFOLDER" && subtitleeditw /convert '*.srt' subrip /inputfolder:"$INFOLDER" /outputfolder:"$OUTFOLDER" /overwrite /FixCommonErrors /MergeSameTimeCodes /MergeSameTexts /MergeShortLines /RedoCasing; 174 | ``` 175 | 176 | _Note: Use single quotes to surround `'*.srt'`_ 177 | 178 | 179 | ## Credits 180 | 181 | - Shell scripts written by Adam Twardoch 182 | - Only tested on my machine, no guarantee 183 | - [The Unlicense](./LICENSE) 184 | - Subtitle Edit is made by Nikolaj Lynge Olsson 185 | 186 | 187 | 188 | #!/usr/bin/env bash 189 | WINEPREFIX=${HOME}/.wine-se/ wine64 "C:/Program Files/Subtitle Edit/SubtitleEdit.exe" "$@" 2>/dev/null 190 | 191 | 192 | 193 | --------------------------------------------------------------------------------