I beleive Michael L Hale stated that he used the ScriptListener to generate code for PhotoShop "menu File>Place". Many things can not be done through in Photoshop Scripting through the Adobe's normal scripting methods Adobe provided for scripting. However Adobe also supplied the ScriptListener.8li plugin which when installed is a bit like the actions palette's action recorded without controls. Everthing that can be recorded in Photoshop is written to two files on your desktop in script code one in Javascript the other VBS. The Script code use an Action Manager Method so thing not posible with normal scripting methods can be use in scripts. The only way to start and stop recording these two script files it to install ScriptListener.8li before you start Photoshop and to uninstall it after you exit Photoshop. Awarkward but better then nothing there is no logic just step, step, step like actions and the code is not all that readable. However you can take that code and modify it to use vars to turn steps into javascript functions and whatever VBS uses.
For example Place
REM =======================================================
DIM objApp
SET objApp = CreateObject("Photoshop.Application")
REM Use dialog mode 3 for show no dialogs
DIM dialogMode
dialogMode = 3
DIM idPlc
idPlc = objApp.CharIDToTypeID( "Plc " )
DIM desc3
SET desc3 = CreateObject( "Photoshop.ActionDescriptor" )
DIM idnull
idnull = objApp.CharIDToTypeID( "null" )
Call desc3.PutPath( idnull, "D:\\Temp\\Portrait\\dsc6234.psd" )
DIM idFTcs
idFTcs = objApp.CharIDToTypeID( "FTcs" )
DIM idQCSt
idQCSt = objApp.CharIDToTypeID( "QCSt" )
DIM idQcsa
idQcsa = objApp.CharIDToTypeID( "Qcsa" )
Call desc3.PutEnumerated( idFTcs, idQCSt, idQcsa )
DIM idOfst
idOfst = objApp.CharIDToTypeID( "Ofst" )
DIM desc4
SET desc4 = CreateObject( "Photoshop.ActionDescriptor" )
DIM idHrzn
idHrzn = objApp.CharIDToTypeID( "Hrzn" )
DIM idRlt
idRlt = objApp.CharIDToTypeID( "#Rlt" )
Call desc4.PutUnitDouble( idHrzn, idRlt, 0.000000 )
DIM idVrtc
idVrtc = objApp.CharIDToTypeID( "Vrtc" )
DIM idRlt
idRlt = objApp.CharIDToTypeID( "#Rlt" )
Call desc4.PutUnitDouble( idVrtc, idRlt, 0.000000 )
DIM idOfst
idOfst = objApp.CharIDToTypeID( "Ofst" )
Call desc3.PutObject( idOfst, idOfst, desc4 )
Call objApp.ExecuteAction( idPlc, desc3, dialogMode )
You can, like me, just leave the scriptlistener plug-in installed all the time. It really does not effect proformance unless the log file are very big. I just keep a eye on the log file and delete it when it starts to get too large. Also it you do not want the output of both the js and vbs logs just set the one you don't want to read only. Photoshop will ingore it and only write to the one you want.
If you do want to uninstall the plug-in a quick way to do so is to rename it by placing a '~' at the start of the name.