This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set text item delimiters to "." | |
tell application "Finder" | |
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list | |
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file. | |
--the 'index' number is of course required for the sequential renaming of our files! | |
set thefileList to {} | |
repeat with index from 1 to the count of all_files | |
--using our index, we select the appropriate file from our list | |
--this variables below are getting the name of files | |
set this_file to item index of all_files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clipboard() { | |
rclone copy dropbox:ok.txt /Users/home/desktop/test_folder/ | |
# copy file to your desktop | |
tail -10 /Users/home/Desktop/test_folder/ok.txt | |
# read the file to make sure the contents have been updated that you are copying | |
cat /Users/home/Desktop/test_folder/ok.txt | pbcopy | |
# copy the contents | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function u() { | |
if [[ $# -eq 0 ]]; then | |
hello_var=$(cat /Users/home/desktop/macbook_pro_scripts/count_open.txt) | |
#first create a text file in this directory | |
#write a number into the file | |
#then will read the number from this file as a variable | |
second=$hello_var | |
let second++ | |
# every time u is pressed will increase the count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendtodropbox() { | |
if [[ $# -eq 0 ]]; then | |
variable_1=$(cat sendtodropbox.txt) | |
rclone purge $variable_1 | |
rclone copy . $variable_1 | |
else | |
fi | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a csv file where you can track your files | |
#template file: | |
#>> cat task-tracking-template.csv | |
# ,3/00/22 | |
# 8am, | |
# 9am, | |
# 10am, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert 1.jpg -alpha set -background none -channel A -evaluate multiply 0.5 +channel 1.png | |
Using ImageMagick to do the convert, to make an image have 50% transparency (less ink during printing). https://imagemagick.org/index.php | |
---------------------------------------- | |
for i in *.jpg; do echo $i; done | |
Looping through files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function 00(){ | |
if [[ $# -eq 0 ]]; then | |
current_folder_count=$(cat /Users/stanleytan/Desktop/macbook_pro_scripts/echo_files/other_test.txt) | |
current_folder_count=$(($current_folder_count + 0)) | |
#echo $current_folder_count | |
second_count=$(cat /Users/stanleytan/desktop/macbook_pro_scripts/echo_files/count_open.txt) | |
second_count=$((second_count+1)) | |
echo -n $second_count > /Users/stanleytan/desktop/macbook_pro_scripts/echo_files/count_open.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#going in and out of folders with CD resets the count | |
function cd() { | |
local x2 the_new_dir adir index | |
local -i cnt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function delete() { | |
echo "sed -i '' '/^#/d'" | |
echo "sed -i '' '/^$/d;G'" | |
} | |
in command line for mac: | |
$ sed -i '' '/^#/d' (yourfilename here) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function browse() { | |
hello_var=$(echo -n `pbpaste`) | |
# set the clipboard to a variable | |
char=":" | |
# char in case there are multiple links | |
hello_var_2=$(awk -F"${char}" '{print NF-1}' <<< "${hello_var}") | |
# checking for mulitple https: links | |
if [ "$hello_var_2" -gt 1 ]; then | |
# if there are multiple links then return this statement | |
echo 'set str1' |