Guest User

Untitled

a guest
Feb 8th, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/osascript
  2.  
  3. set commande to "date +\"%Y-%m-%d-%H.%M.%S\""
  4. set fichier to "capture" & (do shell script commande) & ".png"
  5.  
  6. set localfolder to (path to home folder as string) & "Desktop:"
  7. set cloudfolder to (path to startup disk as string) & "mnt:nfs:nonas-web:vrac:"
  8. set myurl to "http://nonas.ugo235.fr/vrac/" & fichier
  9.  
  10. do shell script "screencapture -i -P  " & (POSIX path of localfolder) & fichier
  11.  
  12. set reponse to (display dialog "Upload to the cloud ?" buttons {"Yes", "No"})
  13. if button returned of reponse = "Yes" then
  14.     tell application "Finder"
  15.         move file (localfolder & fichier) to cloudfolder
  16.         delete (localfolder & fichier)
  17.     end tell
  18.     set the clipboard to myurl
  19.     display alert "URL " & myurl & " copied to the clipboard"
  20. end if
  21.  
  22. tell application "Preview" to close document fichier
  23.  
Advertisement
Add Comment
Please, Sign In to add comment