-
Notifications
You must be signed in to change notification settings - Fork 72
/
psTool.ahk
85 lines (81 loc) · 1.91 KB
/
psTool.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
psTool_get() { ; http://stackoverflow.com/questions/29109677/photoshop-javascript-how-to-get-set-current-tool
app := ComObjActive("Photoshop.Application")
actRef := ComObjCreate("Photoshop.ActionReference")
actRef.putEnumerated( app.charIDToTypeID("capp")
, app.charIDToTypeID("Ordn")
, app.charIDToTypeID("Trgt") )
ActionDescriptor := app.executeActionGet(actRef)
tool_id := ActionDescriptor.getEnumerationType( app.stringIDToTypeID("tool") )
tool_str := app.typeIDToStringID(tool_id)
return tool_str
}
; psTool_set("moveTool")
psTool_set(tool) { ; https://autohotkey.com/boards/viewtopic.php?p=23679#p23679
app := ComObjActive("Photoshop.Application")
desc9 := ComObjCreate("Photoshop.ActionDescriptor")
ref7 := ComObjCreate("Photoshop.ActionReference")
ref7.putClass( app.stringIDToTypeID(tool) )
desc9.putReference( app.charIDToTypeID("null"), ref7 )
app.executeAction( app.charIDToTypeID("slct"), desc9, psDisplayNoDialogs := 3 )
}
/*
moveTool
marqueeRectTool
marqueeEllipTool
marqueeSingleRowTool
marqueeSingleColumnTool
lassoTool
polySelTool
magneticLassoTool
quickSelectTool
magicWandTool
cropTool
sliceTool
sliceSelectTool
spotHealingBrushTool
magicStampTool
patchSelection
redEyeTool
paintbrushTool
pencilTool
colorReplacementBrushTool
cloneStampTool
patternStampTool
historyBrushTool
artBrushTool
eraserTool
backgroundEraserTool
magicEraserTool
gradientTool
bucketTool
blurTool
sharpenTool
smudgeTool
dodgeTool
burnInTool
saturationTool
penTool
freeformPenTool
addKnotTool
deleteKnotTool
convertKnotTool
typeCreateOrEditTool
typeVerticalCreateOrEditTool
typeCreateMaskTool
typeVerticalCreateMaskTool
pathComponentSelectTool
directSelectTool
rectangleTool
roundedRectangleTool
ellipseTool
polygonTool
lineTool
customShapeTool
textAnnotTool
soundAnnotTool
eyedropperTool
colorSamplerTool
rulerTool
handTool
zoomTool
*/