Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- evetaku maintainer vars --
- set episode_patches to {"[EveTaku] Inu x Boku SS - 01 (1280x720 x264 AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 02 (1280x720 x264 AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 03 (1280x720 x264 AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 04 (1280x720 x264 AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 05 (1280x720 x264 AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 06 (1280x720 x264 AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 01 (1280x720 x264-Hi10P AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 02 (1280x720 x264-Hi10P AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 03 (1280x720 x264-Hi10P AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 04 (1280x720 x264-Hi10P AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 05 (1280x720 x264-Hi10P AAC) PATCH.xdelta", "[EveTaku] Inu x Boku SS - 06 (1280x720 x264-Hi10P AAC) PATCH.xdelta"}
- set episode_default_names to {"[EveTaku] Inu x Boku SS - 01v2 (1280x720 x264 AAC)[60294F71].mkv", "[EveTaku] Inu x Boku SS - 02v2 (1280x720 x264 AAC)[454DBD7E].mkv", "[EveTaku] Inu x Boku SS - 03v2 (1280x720 x264 AAC)[ADDB54E6].mkv", "[EveTaku] Inu x Boku SS - 04v2 (1280x720 x264 AAC)[32262CE0].mkv", "[EveTaku] Inu x Boku SS - 05v2 (1280x720 x264 AAC)[40BBDCFD].mkv", "[EveTaku] Inu x Boku SS - 06v2 (1280x720 x264 AAC)[41C07CCB].mkv", "[EveTaku] Inu x Boku SS - 01v2 (1280x720 x264-Hi10P AAC)[4CFEFD1C].mkv", "[EveTaku] Inu x Boku SS - 02v2 (1280x720 x264-Hi10P AAC)[52C6C01B].mkv", "[EveTaku] Inu x Boku SS - 03v2 (1280x720 x264-Hi10P AAC)[74B9971C].mkv", "[EveTaku] Inu x Boku SS - 04v2 (1280x720 x264-Hi10P AAC)[02A80390].mkv", "[EveTaku] Inu x Boku SS - 05v2 (1280x720 x264-Hi10P AAC)[A6F08EDA].mkv", "[EveTaku] Inu x Boku SS - 06v2 (1280x720 x264-Hi10P AAC)[101973E6].mkv"}
- -- end maintainter vars --
- to numsFromChoice(aList, aPrompt, aTitle, mults, CancelText, OKText)
- -- aList is the original list to be numbered, aPrompt is the prompt text, aTitle is the choose from list window title, mults is true for multiple choices allowed and false for single choices, CancelText and OKText set the labels you want to appear on the Cancel and OK buttons.
- set numList to {}
- set chosen to {}
- -- Make a numbered list from the original in "numList".
- repeat with k from 1 to count aList
- set end of numList to (k as text) & ") " & item k of aList
- end repeat
- -- Offer a choice from the numbered list
- set choices to choose from list numList with prompt aPrompt multiple selections allowed mults with title aTitle cancel button name CancelText OK button name OKText
- if choices is not false then -- i.e., something was chosen (empty selection defaults to false)
- -- Extract the numbers only from the choices found in list "choices".
- repeat with j from 1 to count choices
- tell choices to set end of chosen to (text 1 thru ((my (offset of ")" in item j)) - 1) of item j) as integer
- end repeat
- return chosen -- Return a list of item numbers for chosen list items
- else -- choices was false, the CancelText button was chosen (always returns false no matter what it is called).
- return false -- pass back the false
- end if
- end numsFromChoice
- set patchfile_number to numsFromChoice(episode_patches, "Choose a patch.", "Patch Picker", false, "Cancel", "Okay")
- set patchfile_name to item patchfile_number of episode_patches
- set episode_out_name to item patchfile_number of episode_default_names
- set episode_in_apple_path to choose file with prompt "Please open the corrisponding episode for " & patchfile_name
- set episode_in_path to the quoted form of the POSIX path of episode_in_apple_path as string
- set episode_out_apple_path to choose file name default name episode_out_name with prompt "Choose episode destination:"
- set episode_out_path to the quoted form of the POSIX path of episode_out_apple_path as string
- set xdelta_apple_path to path to resource "xdelta3"
- set patch_apple_path to path to resource patchfile_name
- set xdelta_path to the quoted form of the POSIX path of xdelta_apple_path as string
- set patch_path to the quoted form of the POSIX path of patch_apple_path as string
- set script_code to xdelta_path & " -d -s " & episode_in_path & " " & patch_path & " " & episode_out_path as string
- do shell script script_code
Add Comment
Please, Sign In to add comment