text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set eof of the theFile to 0 | AppleNotesExporter.applescript |
write theText to theFile starting at eof as «class utf8» | AppleNotesExporter.applescript |
display dialog "Done! | AppleNotesExporter.applescript |
Thanks for using AppleNotesExporter. | AppleNotesExporter.applescript |
https://www.github.com/kzaremski" buttons {"Nice 🔥"} default button "Nice 🔥" | AppleNotesExporter.applescript |
set p to application process "Alacritty" | open-terminal.scpt |
set t to current terminal | open-terminal.scpt |
tell (make new session at the end of sessions) | open-terminal.scpt |
exec command ("vim \"" & POSIX path of first item of input as text) & "\"" | open-terminal.scpt |
if not runs then | open-terminal.scpt |
terminate first session | open-terminal.scpt |
set thisCaseId to "json-spotCheck" | json copy.applescript |
set asProjectPath to configSystem's getValue("AppleScript Core Project Path") | json copy.applescript |
Read JSON File - Dictionary | json copy.applescript |
Read JSON File - List | json copy.applescript |
Convert object to JSON String | json copy.applescript |
set jsonData to readJsonFile(asProjectPath & "/test/fixtures/sample-1.json") | json copy.applescript |
log jsonData | json copy.applescript |
log |menu| of jsonData | json copy.applescript |
log menuitem of popup of |menu| of jsonData | json copy.applescript |
log readJsonFile(asProjectPath & "/test/fixtures/sample-2.json") | json copy.applescript |
log toJsonString({|name|:"Hadooken", startDate:missing value}) | json copy.applescript |
log class of fromJsonString("{\"name\":\"Havok\", \"last\":\"Noise\"}") | json copy.applescript |
on readJsonFile(posixPath) | json copy.applescript |
set jsonFile to POSIX file posixPath | json copy.applescript |
set jsonText to _readFile(jsonFile) | json copy.applescript |
tell application "JSON Helper" to read JSON from jsonText | json copy.applescript |
end readJsonFile | json copy.applescript |
on fromJsonString(jsonText) | json copy.applescript |
end fromJsonString | json copy.applescript |
on toJsonString(serializableObject) | json copy.applescript |
make JSON from serializableObject | json copy.applescript |
on _readFile(theFile) | json copy.applescript |
end _readFile | json copy.applescript |
set logger to std's import("logger")'s new("json") | json copy.applescript |
do shell script "open -a Safari " & quoted form of location | openinsafari.scpt |
return run script (POSIX file "/Users/IceHe/Documents/AppleScript/Lib/get_flag.applescript") with parameters {flag} | is_daily_task_run.applescript |
on run {downloadsFolder_Path_monitor, MacYTDL_preferences_path_monitor, YTDL_TimeStamps_monitor, ytdl_settings_monitor, URL_user_entered_monitor, YTDL_log_file_monitor, download_filename_monitor, download_filename_new_monitor, MacYTDL_custom_icon_file_posix_monitor, monitor_dialog_position, YTDL_simulate_log_monitor, diag_Title_quoted_monitor, is_Livestream_Flag_monitor, screen_width, screen_height, DL_Use_YTDLP, path_to_MacYTDL} | Monitor.applescript |
set number_of_monitors_per_column to round (screen_height / 200) | Monitor.applescript |
set column_number to (round (monitor_dialog_position / number_of_monitors_per_column) rounding up) | Monitor.applescript |
set X_position_monitor to screen_width - (250 * column_number) | Monitor.applescript |
set row_number to (monitor_dialog_position - (number_of_monitors_per_column * (column_number - 1))) - 1 | Monitor.applescript |
set Y_position_monitor to (row_number * 150) | Monitor.applescript |
set download_finished to "No" | Monitor.applescript |
set YTDL_log_file_monitor_posix to POSIX file YTDL_log_file_monitor | Monitor.applescript |
set MacYTDL_custom_icon_file_not_posix_monitor to POSIX file MacYTDL_custom_icon_file_posix_monitor as text | Monitor.applescript |
set shellPath to "PATH=$PATH:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:~/opt/bin:~/opt/sbin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:" & quoted form of (POSIX path of ((path to me as text) & "::")) & "; " | Monitor.applescript |
set downloadsFolder_Path_monitor_quoted to quoted form of downloadsFolder_Path_monitor | Monitor.applescript |
set YTDL_log_file_monitor_quoted to quoted form of YTDL_log_file_monitor | Monitor.applescript |
set diag_Title_monitor to quoted form of diag_Title_quoted_monitor | Monitor.applescript |
set diag_Title_quoted_monitor to quoted form of diag_Title_quoted_monitor | Monitor.applescript |
if YTDL_TimeStamps_monitor is not "" then | Monitor.applescript |
set YTDL_TimeStamps_monitor_quoted to quoted form of YTDL_TimeStamps_monitor | Monitor.applescript |
set YTDL_TimeStamps_monitor_quoted to "" | Monitor.applescript |
set MacYTDL_custom_icon_file_not_posix_monitor_quoted to quoted form of MacYTDL_custom_icon_file_not_posix_monitor -- Passed to Adviser for display dialog | Monitor.applescript |
if download_filename_new_monitor contains "_" then | Monitor.applescript |
set download_filename_new_monitor_plain to my replace_chars(download_filename_new_monitor, "_", " ") | Monitor.applescript |
set download_filename_new_monitor_plain to download_filename_new_monitor | Monitor.applescript |
if URL_user_entered_monitor contains "&" then | Monitor.applescript |
set number_of_URLs to number of text items in URL_user_entered_monitor | Monitor.applescript |
set URL_user_entered_monitor_quoted to "" | Monitor.applescript |
repeat with current_URL in text items of URL_user_entered_monitor | Monitor.applescript |
set URL_user_entered_monitor_quoted to URL_user_entered_monitor_quoted & current_URL & " " | Monitor.applescript |
set URL_user_entered_monitor_quoted to quoted form of URL_user_entered_monitor | Monitor.applescript |
set URL_user_entered_monitor_quoted to URL_user_entered_monitor | Monitor.applescript |
set monitor_state_flag to "Downloading" | Monitor.applescript |
set ytdl_settings_monitor to items 2 thru -1 of ytdl_settings_monitor as string | Monitor.applescript |
if URL_user_entered_monitor_quoted is "Null" then | Monitor.applescript |
if character -1 of download_filename_monitor is linefeed then | Monitor.applescript |
set download_filename_monitor to text 1 thru -2 of download_filename_monitor | Monitor.applescript |
if ytdl_settings_monitor contains "--recode-video" then | Monitor.applescript |
set look_for_extension_1 to character -4 of download_filename_monitor | Monitor.applescript |
set look_for_extension_2 to character -5 of download_filename_monitor | Monitor.applescript |
if look_for_extension_1 is "." or look_for_extension_2 is "." then | Monitor.applescript |
set all_words to words in ytdl_settings_monitor | Monitor.applescript |
set the_first_file_name to first paragraph of download_filename_monitor | Monitor.applescript |
if download_filename_new_monitor_plain is "the saved batch" then | Monitor.applescript |
set download_filename_monitor to replace_chars(download_filename_monitor, old_extension, new_extension) | Monitor.applescript |
set download_filename_new_monitor_plain to replace_chars(download_filename_new_monitor_plain, old_extension, new_extension) | Monitor.applescript |
if ytdl_settings_monitor contains "--audio-format" then | Monitor.applescript |
set AppleScript's text item delimiters to {"audio-format ", " --audio-quality"} | Monitor.applescript |
set new_extension to second text item of ytdl_settings_monitor | Monitor.applescript |
set monitor_DL_Use_YTDLP to "yt-dlp" | Monitor.applescript |
set monitor_DL_Use_YTDLP to DL_Use_YTDLP | Monitor.applescript |
set youtubedl_pid to do shell script shellPath & "cd " & downloadsFolder_Path_monitor_quoted & " ; " & YTDL_TimeStamps_monitor_quoted & " " & monitor_DL_Use_YTDLP & " " & ytdl_settings_monitor & " " & URL_user_entered_monitor_quoted & " &> " & YTDL_log_file_monitor_quoted & " & echo $!" | Monitor.applescript |
set monitor_pid to do shell script "pgrep -n osascript &" | Monitor.applescript |
on error errtext | Monitor.applescript |
display dialog "There was an error with the pgrep:" & errtext | Monitor.applescript |
set DL_description_monitor to "No" | Monitor.applescript |
if ytdl_settings_monitor contains "description" then | Monitor.applescript |
set DL_description_monitor to "Yes" | Monitor.applescript |
set path_to_monitor to (path to me) as string -- <= Duplicates line of code at beginning of this script except "string" instead of "text" | Monitor.applescript |
set path_to_scripts to text 1 thru -13 of path_to_monitor | Monitor.applescript |
set myAdviserScriptAsString to quoted form of POSIX path of (path_to_scripts & "adviser.scpt") | Monitor.applescript |
set download_filename_monitor_quoted to quoted form of download_filename_monitor | Monitor.applescript |
set download_filename_new_monitor to quoted form of download_filename_new_monitor | Monitor.applescript |
set download_filename_new_monitor_plain_quoted to quoted form of download_filename_new_monitor_plain | Monitor.applescript |
set YTDL_simulate_log_monitor_quoted to quoted form of YTDL_simulate_log_monitor | Monitor.applescript |
set MacYTDL_preferences_path_monitor_quoted to quoted form of MacYTDL_preferences_path_monitor | Monitor.applescript |
set adviser_params to monitor_pid & " " & youtubedl_pid & " " & MacYTDL_custom_icon_file_not_posix_monitor_quoted & " " & MacYTDL_preferences_path_monitor_quoted & " " & YTDL_log_file_monitor_quoted & " " & downloadsFolder_Path_monitor_quoted & " " & diag_Title_quoted_monitor & " " & DL_description_monitor & " " & is_Livestream_Flag_monitor & " " & download_filename_monitor_quoted & " " & download_filename_new_monitor & " " & download_filename_new_monitor_plain_quoted & " " & YTDL_simulate_log_monitor_quoted | Monitor.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.