You don't need to relaunch Photoshop. There is a way to create / replace a shortcut:
Let's say you already have Photoshop Workspace ('Window / Workspace') named 'Profile'.
That workspace during creation was bound to your Keyboard Shortcuts, and now is chosen.
You want to make 'F2' shortcut to 'Alert' script that currently doesn't have any shortcut.
Later you even want to change previously chosen shortcut to the same 'Alert' script for 'F3'
'Profile' workspace, 'Alert' script and 'F2', 'F3' shortcuts can be changed for your needs...
Code: Select all
function rw(v1, v2, v3) {v2.open(v1), v1 < 'w' ? v3 = v2.read() : v2.write(v3), v2.close(); return v3}
function sTT(v) {return stringIDToTypeID(v)} function wrk(v1, v2, v3, v4, v5) {
eval("(ref1" + (nA = " = new Action") + (R = "Reference") + "()).put" +
(v1 == 'make' ? "Class" : "Name") + "(sTT(" + (w = "'workspace'") + "), v2)")
for(i = 0; i < (arr = [R + "(sTT('null'), ref", "String(sTT('name'), v"]).length; i++) {
eval("(dsc" + (I = i + 1) + nA + "Descriptor()).put" + arr[i] + I + ")")
}
for(i = 0; i < (arr = ['palette', 'keyboard' + (C = 'Customization'), 'menu' + C, 'replace']).length; i++) {
eval("dsc2.putBoolean(sTT(arr[i]), " + (i ? "true" : "v" + (i + 3)) + ")")
}
dsc1.putObject(sTT('using'), sTT(w), dsc2), executeAction(sTT(v1), dsc1, DialogModes.NO)
// v1: 'make', 'select', 'reset', 'delete'; v2: workspace name; v3: boolean, v4: boolean, v5: boolean
}
ver = version.slice(0, 2) > 13 ? '.psw' : ''
pth = File(Folder.userData + '/Adobe/' + (fld = Folder.startup.displayName.match
(/.*?(?=( \(|$))/)[0]) + '/' + fld + ' Settings/WorkSpaces/Profile' + ver)
rd = rw('r', pth); if (!/Script_Alert/.test(rd)) {
rd = rd.replace(/(modified="(?:0|1)">\n)\t(<command)/,
'$1\t<command kind="dynamic" name="Script_Alert">' +
'\r\t\t<shortcut>F2</shortcut>\r\t</command>\r\t$2')
rw('w', pth, rd)
}
else rw('w', pth, rd.replace(/(_Alert">\n\t\t<shortcut>)F2</, '$1F3<'))
wrk('reset', 'Profile', false, false, false)