Keyboard Shortcut to Run Macro Question (Image-Pro 10)
Hello,
I would like to set keyboard shortcuts for various macro functions I have already coded. However, looking at the previous questions on this forum has not been very helpful.
Here is the macro code I have now, which is not yet operating as I do not know what to enter If/When:
I would like to set keyboard shortcuts for various macro functions I have already coded. However, looking at the previous questions on this forum has not been very helpful.
Here is the macro code I have now, which is not yet operating as I do not know what to enter If/When:
Public Function Auto_All() As SimpleScript
Auto_All = New SimpleScript
Auto_All.Shortcut = MediaCy.IQL.Application.mcScriptShortcut.CtrlW
With Automate.ScriptingCommands.CodeCommand(Auto_All)
If .Run() Then
'not sure what to put here, previous post said "user code"
End If
End With
'Rest of macro code
Here is the app button click code:Public Sub button6_Click(sender As Object, e As System.EventArgs) Handles button6.Click
Auto_All()
End Sub
Does anyone know what user code I would enter to create the shortcut to run the macro? Thank you!0
Answers
-
I see that the shortcut for your macro is Ctrl-W. Is you macro executed when you hit Ctrl-W?
Yuri
0 -
Hello,
No, there is a pop-up window that states "ChangeType operation is not supported".
Here is the macro code just in case:Public Function Auto_All() As SimpleScript Auto_All = New SimpleScript Auto_All.Shortcut = MediaCy.IQL.Application.mcScriptShortcut.CtrlW With Automate.ScriptingCommands.CodeCommand(Auto_All) If .Run() Then End If End With Dim trdoc1 With Application.RibbonCommands.SelectRibbonTab(Auto_All) .TabName = "TrackingTab" .Run() End With With Application.DocumentCommands.Active(Auto_All) .Run(trdoc1) End With With Measure.TrackingCommands.FindTracksAuto(Auto_All) .Interactive = True .Run(trdoc1) End With With Application.RibbonCommands.SelectRibbonTab(Auto_All) .TabName = "Share" .Run() End With Measure.Data.CollectorCommands.Clear(Auto_All).Run() With Measure.Data.CollectorCommands.Collect(Auto_All) .Run(New List({trdoc1})) End With End Function
0 -
This message means that there is an error in the macro and the macro cannot be loaded or executed. The error message reports the line and position of the error. Please check that line and try to fix the error.
Yuri
0 -
I changed the format of the image and that resolved the issue, everything is working now. Thank you so much!
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions