Content Created: July, 1999 / Updated: November 10, 2005
OneClick is a really amazing macro utility for the Macintosh. You owe it to yourself to visit WestCode's site to look into it. (Well, if you have a Macintosh, that is, because there's no Windows version...) I use it every day for many different tasks!
For more information about how OneClick works, take a look at the OneClick Fan Site.
Back 'em Up v1.0
On DragAndDrop Variable theFile, theLabel theFile = ListItems GetDragAndDrop, 1 Button.Data = theFile End DragAndDrop On MouseDown Variable saveFile, saveLabel, temp Variable Global theGlobalFile, theGlobalLabel saveFile = theGlobalFile // save old value of theGlobalFile, in case it's being used elsewhere saveLabel = theGlobalLabel theGlobalFile = Button.Data AppleScript set theFile to (get OneClick variable "theGlobalFile") tell application "Finder" return (label index of (file theFile)) end tell End AppleScript theGlobalLabel = ASResult theGlobalLabel = PopupMenu "~File: " & theGlobalFile & "<RETURN>-<RETURN>0<RETURN>1<RETURN>2<RETURN>3<RETURN>4<RETURN>5<RETURN>6<RETURN>7", theGlobalLabel If theGlobalLabel <> "" AppleScript set theFile to (get OneClick variable "theGlobalFile") set theLabel to (get OneClick variable "theGlobalLabel") tell application "Finder" set the (label index of (file theFile)) to theLabel end tell End AppleScript End If theGlobalFile = saveFile // restore theGlobalFile theGlobalLabel = saveLabel End MouseDown |
Variable theName
Variable theWidth
Variable pos
Variable prefix
prefix = "IMG-"
theName = Button.Data
pos = Find "/", theName
If pos = 0
theName = ""
theWidth = "600"
Else
theWidth = SubString theName, pos + 1, - 1
theName = SubString theName, 1, pos - 1
End If
If OptionKey
theWidth = AskText "Please enter the new width.", theWidth, "-1"
End If
theName = AskText "Please enter the name of the file ('" & prefix & "' will be put before and '.jpg' after.)", theName, "-1"
If theName = "-1"
Exit
End If
Button.Data = theName & "/" & theWidth
SelectMenu "Picture", "Size", "Scaleä"
Type theWidth
Pause 30
SelectButton "OK"
Pause 5
SelectMenu "File", "Save asä"
// SelectPopUp Global 580, 179, "JPEG/JFIF"
Speak "please change to J PEG"
Repeat 20
Pause 10
Type Command "c"
If Find ".jpg", Clipboard
Speak "thank you"
Exit Repeat
End If
End Repeat
Type prefix & theName & ".jpg"
SelectButton "Save"
Pause 10
SelectMenu "Picture", "Size", "Scaleä"
Type (theWidth / 4)
Pause 30
SelectButton "OK"
Pause 5
SelectMenu "File", "Save asä"
Type prefix & theName & "-s.jpg"
SelectButton "Save"
SelectMenu "File", "Close"
Speak "all done"
|