tabnation

python ahk mass image maker

Mar 26th, 2026
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. ================python===================
  2.  
  3. import os
  4.  
  5. # Folder with your files
  6. folder = r"C:\Users\thoma\OneDrive\Desktop\openmoji"
  7.  
  8. # URL you want added before each filename
  9. base_url = "https://github.com/tabnation/printpages/blob/main/images%20for%20com%20board/openmoji/"
  10.  
  11. # Output text file
  12. output_file = "image_urls.txt"
  13.  
  14. with open(output_file, "w", encoding="utf-8") as f:
  15. for file in os.listdir(folder):
  16. path = os.path.join(folder, file)
  17.  
  18. if os.path.isfile(path):
  19. url = base_url + file
  20. f.write(url + "\n")
  21.  
  22. print("Done! URLs saved to", output_file)
  23.  
  24.  
  25. ================ahk v1===================
  26.  
  27. folder := "C:\Users\thoma\OneDrive\Desktop\images"
  28. baseURL := "https://github.com/tabnation/printpages/blob/main/images%20for%20com%20board/openmoji/"
  29. outputFile := "image_urls.txt"
  30.  
  31. FileDelete, %outputFile%
  32.  
  33. Loop, Files, %folder%\*.*, F
  34. {
  35. url := baseURL . A_LoopFileName
  36. FileAppend, %url%`n, %outputFile%
  37. }
  38.  
  39. MsgBox, Done! URLs saved to %outputFile%
  40.  
  41.  
  42. ================ahk v2===================
  43.  
  44.  
  45. folder := "C:\Users\thoma\OneDrive\Desktop\images"
  46. baseURL := "https://github.com/tabnation/printpages/blob/main/images%20for%20com%20board/openmoji/"
  47. outputFile := "image_urls.txt"
  48.  
  49. if FileExist(outputFile)
  50. FileDelete(outputFile)
  51.  
  52. loop files folder "\*.*", "F"
  53. {
  54. url := baseURL . A_LoopFileName
  55. FileAppend(url "`n", outputFile)
  56. }
  57.  
  58. MsgBox "Done! URLs saved to " outputFile
Add Comment
Please, Sign In to add comment