

(script-fu-register
    "script-fu-quick-save-jpg"  ;func name
    "quick-save-jpg "    ;menu label
    " "    ;description
    " "    ;author
    " "    ;copyright notice
    " "    ;date created
    "*"    ;image type that the script works on
    SF-IMAGE    "Image"                 0
    SF-DRAWABLE "Drawable"              0

)

(script-fu-menu-register "script-fu-quick-save-jpg" "<Image>/Tools")
(define (script-fu-quick-save-jpg image drawable )

    ;start
    (gimp-context-push)
    (gimp-image-undo-group-start image)
    
    ;put your procedures here

    (let* (
          (file-name (car (gimp-item-get-name 2)))
          )


(file-jpeg-export
    #:run-mode RUN-NONINTERACTIVE
    #:image image
    #:file (string-append file-name "-backup.jpg")
    #:options -1
    #:quality 0.85
    #:smoothing 0.0
    #:optimize TRUE
    #:progressive FALSE
    #:cmyk FALSE
    #:sub-sampling "sub-sampling-2x1"
    #:baseline TRUE
    #:restart 0
    #:dct "integer"
    #:include-exif FALSE
    #:include-iptc FALSE
    #:include-xmp FALSE
    #:include-color-profile FALSE
    #:include-thumbnail FALSE
    #:include-comment FALSE
  )


    (gimp-image-clean-all image)

    ;finish
    (gimp-image-undo-group-end image)
    (gimp-context-pop)
    (gimp-displays-flush)
)
)
