text
stringlengths
0
15.7k
source
stringlengths
6
112
set instructions_text to theInstructionsTextLabel
Main.applescript
set theDiagPromptLabel to localized string "Utilities" from table "MacYTDL"
Main.applescript
set utilities_diag_prompt to theDiagPromptLabel
Main.applescript
set accViewWidth to 600
Main.applescript
set accViewInset to 75
Main.applescript
set theButtonsDeleteLogsLabel to localized string "Delete logs" from table "MacYTDL"
Main.applescript
set theButtonsUninstallLabel to localized string "Uninstall" from table "MacYTDL"
Main.applescript
set theButtonsAboutLabel to localized string "About MacYTDL" from table "MacYTDL"
Main.applescript
set theButtonsStartLabel to localized string "Start" from table "MacYTDL"
Main.applescript
set {theButtons, minWidth} to create buttons {theButtonsDeleteLogsLabel, theButtonsUninstallLabel, theButtonsAboutLabel, theButtonCancelLabel, theButtonsStartLabel} button keys {"d", "U", "a", ".", ""} default button 5
Main.applescript
if minWidth > accViewWidth then set accViewWidth to minWidth
Main.applescript
set {theUtilitiesRule, theTop} to create rule 10 rule width accViewWidth
Main.applescript
set theCheckBoxRemoveServiceLabel to localized string "Remove Service" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Service_Install, theTop} to create checkbox theCheckBoxRemoveServiceLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set theCheckBoxInstallServiceLabel to localized string "Install Service" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Service_Install, theTop} to create checkbox theCheckBoxInstallServiceLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
if Atomic_is_installed is true then
Main.applescript
set theCheckBoxRemoveAtomicLabel to localized string "Remove Atomic Parsley" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Atomic_Install, theTop} to create checkbox theCheckBoxRemoveAtomicLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set theCheckBoxInstallAtomicLabel to localized string "Install Atomic Parsley" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Atomic_Install, theTop} to create checkbox theCheckBoxInstallAtomicLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set ffmpeg_version_arch to text item 4 of ffmpeg_version_long
Main.applescript
set switch_FFmpeg to "No"
Main.applescript
set installed_FFmpeg_arch to "ARM"
Main.applescript
if ffmpeg_version_arch is "tessus" then
Main.applescript
set installed_FFmpeg_arch to "Intel"
Main.applescript
set new_FFmpeg_arch to "ARM"
Main.applescript
set new_FFmpeg_arch to "Intel"
Main.applescript
if user_system_arch is "arm64" and homebrew_ffmpeg_exists is false then
Main.applescript
set theCheckBoxSwitchFFmpegLabel2 to localized string "Switch FFmpeg to" from table "MacYTDL"
Main.applescript
set theCheckBoxSwitchFFmpegLabel to theCheckBoxSwitchFFmpegLabel2 & " " & new_FFmpeg_arch
Main.applescript
set {utilities_theCheckbox_SwitchFFmpeg, theTop} to create checkbox theCheckBoxSwitchFFmpegLabel left inset accViewInset bottom (theTop + 5) max width 200
Main.applescript
set {utilities_theCheckbox_SwitchFFmpeg, theTop} to create label " " left inset accViewInset + 5 bottom (theTop - 17) max width minWidth - 100 aligns left aligned
Main.applescript
if homebrew_ffmpeg_exists is false then
Main.applescript
set theCheckBoxCheckFFmpegLabel to localized string "Check for FFmpeg update" from table "MacYTDL"
Main.applescript
set theCheckBoxCheckFFmpegversion to theCheckBoxCheckFFmpegLabel & " " & "(" & FFMpeg_version_installed & ")"
Main.applescript
set {utilities_theCheckbox_FFmpeg_Check, theTop} to create checkbox theCheckBoxCheckFFmpegversion left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set {utilities_theCheckbox_FFmpeg_Check, theTop} to create label " " left inset accViewInset + 5 bottom (theTop - 17) max width minWidth - 100 aligns left aligned
Main.applescript
set theCheckBoxCheckMacYTDLLabel to localized string "Check for MacYTDL update" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_MacYTDL_Check, theTop} to create checkbox theCheckBoxCheckMacYTDLLabel left inset accViewInset bottom (theTop + 5) max width 200
Main.applescript
set theCheckBoxReturnDefaultsLabel to localized string "Return to default settings" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Return_Defaults, theTop} to create checkbox theCheckBoxReturnDefaultsLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set theCheckBoxRestoreSettingsLabel to localized string "Restore settings" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Restore_Settings, theTop} to create checkbox theCheckBoxRestoreSettingsLabel & " " & current_settings_installed left inset accViewInset bottom (theTop + 5) max width 200
Main.applescript
set theCheckBoxSaveSettingsLabel to localized string "Save current settings" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Save_Settings, theTop} to create checkbox theCheckBoxSaveSettingsLabel left inset accViewInset bottom (theTop + 5) max width 200
Main.applescript
set theCheckBoxSwitchScriptsLabel to localized string "Switch to yt-dlp" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Switch_Scripts, theTop} to create checkbox theCheckBoxSwitchScriptsLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set utilities_DL_Use_YTDLP to "youtube-dl"
Main.applescript
set {utilities_theCheckbox_Switch_Scripts, theTop} to create label " " left inset accViewInset + 5 bottom (theTop - 17) max width minWidth - 100 aligns left aligned with multiline
Main.applescript
set utilities_DL_Use_YTDLP to "yt-dlp"
Main.applescript
set theCheckBoxOpenYTDLLabel to (localized string "Open" from table "MacYTDL") & " " & utilities_DL_Use_YTDLP & " " & (localized string "web page" from table "MacYTDL")
Main.applescript
set {utilities_theCheckbox_YTDL_release, theTop} to create checkbox theCheckBoxOpenYTDLLabel left inset accViewInset bottom (theTop + 5) max width 200
Main.applescript
if ytdlp_exists is true and (DL_Use_YTDLP is "yt-dlp" or DL_Use_YTDLP is "yt-dlp-legacy") then
Main.applescript
set theCheckBoxCheckYTDLLabel to (localized string "Check for" from table "MacYTDL") & " " & utilities_DL_Use_YTDLP & " " & (localized string "update" from table "MacYTDL")
Main.applescript
set theCheckBoxCheckYTDLversion to theCheckBoxCheckYTDLLabel & " " & "(" & theYTDLVersionInstalledlabel & ")"
Main.applescript
set {utilities_theCheckbox_YTDL_Check, theTop} to create checkbox theCheckBoxCheckYTDLversion left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set {utilities_theCheckbox_YTDL_Check, theTop} to create label " " left inset accViewInset + 5 bottom (theTop - 17) max width minWidth - 100 aligns left aligned with multiline
Main.applescript
set theCheckBoxOpenDLFolderLabel to localized string "Open download folder" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_DL_Open, theTop} to create checkbox theCheckBoxOpenDLFolderLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set theCheckBoxOpenLogFolderLabel to localized string "Open log folder" from table "MacYTDL"
Main.applescript
set {utilities_theCheckbox_Logs_Open, theTop} to create checkbox theCheckBoxOpenLogFolderLabel left inset accViewInset bottom (theTop + 5) max width 250
Main.applescript
set {utilities_instruct, theTop} to create label instructions_text left inset accViewInset + 5 bottom (theTop + 10) max width minWidth - 100 aligns left aligned with multiline
Main.applescript
set {utilities_prompt, theTop} to create label utilities_diag_prompt left inset 0 bottom (theTop) max width minWidth aligns center aligned with bold type
Main.applescript
set utilities_allControls to {theUtilitiesRule, utilities_theCheckbox_Service_Install, utilities_theCheckbox_Atomic_Install, utilities_theCheckbox_SwitchFFmpeg, utilities_theCheckbox_FFmpeg_Check, utilities_theCheckbox_MacYTDL_Check, utilities_theCheckbox_Return_Defaults, utilities_theCheckbox_Save_Settings, utilities_theCheckbox_Restore_Settings, utilities_theCheckbox_Switch_Scripts, utilities_theCheckbox_YTDL_release, utilities_theCheckbox_YTDL_Check, utilities_theCheckbox_DL_Open, utilities_theCheckbox_Logs_Open, MacYTDL_icon, utilities_instruct, utilities_prompt}
Main.applescript
set {utilities_button_returned, utilities_button_number_returned, utilities_controls_results, finalPosition} to display enhanced window diag_Title buttons theButtons acc view width minWidth acc view height theTop acc view controls utilities_allControls initial position window_Position
Main.applescript
if utilities_button_number_returned is 5 then -- Start
Main.applescript
set utilities_Service_choice to item 2 of utilities_controls_results -- <= Install Service choice
Main.applescript
set utilities_Atomic_choice to item 3 of utilities_controls_results -- <= Install Atomic Parsley choice
Main.applescript
set utilities_FFmpeg_switch_choice to item 4 of utilities_controls_results -- <= Switch FFmpeg architecture
Main.applescript
set utilities_FFmpeg_check_choice to item 5 of utilities_controls_results -- <= Check FFmpeg version choice
Main.applescript
set utilities_MacYTDL_check_choice to item 6 of utilities_controls_results -- <= Check MacYTDL version choice
Main.applescript
set utilities_Return_Defaults_choice to item 7 of utilities_controls_results -- <= Return to default settings choice
Main.applescript
set utilities_Save_Settings_choice to item 8 of utilities_controls_results -- <= Save current settings choice
Main.applescript
set utilities_Restore_Settings_choice to item 9 of utilities_controls_results -- <= Restore saved settings choice
Main.applescript
set utilities_Switch_choice to item 10 of utilities_controls_results -- <= Switch downloaders choice
Main.applescript
set utilities_YTDL_webpage_choice to item 11 of utilities_controls_results -- <= Show YTDL/yt-dlp web page choice
Main.applescript
set utilities_YTDL_check_choice to item 12 of utilities_controls_results -- <= Check YTDL/yt-dlp version choice
Main.applescript
set utilities_DL_folder_choice to item 13 of utilities_controls_results -- <= Open download folder choice
Main.applescript
set utilities_log_folder_choice to item 14 of utilities_controls_results -- <= Open log folder choice
Main.applescript
if utilities_log_folder_choice is true then
Main.applescript
open (MacYTDL_preferences_path as POSIX file)
Main.applescript
set the position of the front Finder window to {200, 200}
Main.applescript
if utilities_DL_folder_choice is true then
Main.applescript
check_download_folder(downloadsFolder_Path)
Main.applescript
open (downloadsFolder_Path as POSIX file) -- <= Had to read prefs again to get this working - something to do with this path in Main Dialog
Main.applescript
set the position of the front Finder window to {100, 100} -- <= This DOES work but is ugly - it opens the window then moves it to a location which should not overlap Main Dialog
Main.applescript
if utilities_YTDL_check_choice is true and utilities_FFmpeg_check_choice is true then
Main.applescript
if ffmpeg_version is "Not installed" then
Main.applescript
set theFFmpegProbeInstalledAlertLabel to localized string "FFmpeg and FFprobe have been installed." from table "MacYTDL"
Main.applescript
set alert_text_ffmpeg to theFFmpegProbeInstalledAlertLabel
Main.applescript
check_ffmpeg()
Main.applescript
display dialog alert_text_ytdl & return & alert_text_ffmpeg with title diag_Title buttons {theButtonOKLabel} default button 1 with icon file MacYTDL_custom_icon_file giving up after 600
Main.applescript
else if utilities_FFmpeg_check_choice is true and utilities_YTDL_check_choice is not true then
Main.applescript
display dialog alert_text_ffmpeg & return & return with title diag_Title buttons {theButtonOKLabel} default button 1 with icon file MacYTDL_custom_icon_file giving up after 600
Main.applescript
else if utilities_YTDL_check_choice is true and utilities_FFmpeg_check_choice is not true then
Main.applescript
display dialog alert_text_ytdl & return with title diag_Title buttons {theButtonOKLabel} default button 1 with icon file MacYTDL_custom_icon_file giving up after 600
Main.applescript
if utilities_FFmpeg_switch_choice is true then
Main.applescript
set theFFmpegSwitchLabel to localized string "Switch FFmpeg and FFprobe from" from table "MacYTDL"
Main.applescript
set theFFmpegToLabel to localized string " to " from table "MacYTDL"
Main.applescript