Last active
April 27, 2024 22:06
-
-
Save scripting/36bec44af6892abb870c5fa798bf7431 to your computer and use it in GitHub Desktop.
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
on letsWatchThatStinkingFolder () { | |
«Changes | |
«3/7/23; 11:55:58 AM by DW | |
«Created. | |
local (prefix = "chat-gpt-"); | |
local (sourcefolder = "Macintosh HD:Users:davewiner:Downloads:"); | |
local (destfolder = user.prefs.publicfolder + "chatgpt:"); | |
fileloop (f in sourcefolder) { | |
local (fname = file.filefrompath (f)); | |
if fname beginswith prefix { | |
local (filetext = file.readwholefile (f)); | |
local (relpath = file.getdatepath () + string.delete (fname, 1, sizeof (prefix))); | |
local (url = "http://scripting.com/publicfolder/chatgpt/" + string.replaceall (relpath, ":", "/")); | |
local (fdest = destfolder + relpath); | |
file.surefilepath (fdest); | |
file.writewholefile (fdest, filetext); | |
clock.waitseconds (3); | |
webbrowser.openurl (url); | |
file.delete (f) | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment