Error: "Cannot Run Dialog. Not Found"

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
JoeBly
Newbie
Posts: 4
Joined: Tue Dec 04, 2018 12:29 am

Error: "Cannot Run Dialog. Not Found"

Post by JoeBly » Wed Oct 23, 2019 12:10 am

I just updated from 14.5.4 to 14.5.5. This code snippet used to run fine in 14.5.4, now when I run the script in 14.5.5, it throws up an error stating "Cannot Run Dialog DIALOG1. Not Found". The dialog is below. Did something change with this version?

Code: Select all

let>strLastFolder=Z:\
Dialog>Dialog1
object Dialog1: TForm
  Left = 635
  Top = 307
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Select Folder'
  ClientHeight = 182
  ClientWidth = 476
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object MSFolderName: TEdit
    Left = 27
    Top = 32
    Width = 318
    Height = 21
    TabOrder = 0
    Text = '(Enter Folder Name)'
  end
  object MSButton1: tMSButton
    Left = 360
    Top = 31
    Width = 73
    Height = 25
    Caption = 'Choose Folder'
    TabOrder = 1
    DoBrowse = False
    InitialDir = '%strLastFolder%'
    BrowseStyle = fbFolder
  end
  object MSButton2: tMSButton
    Left = 360
    Top = 79
    Width = 73
    Height = 25
    Caption = 'Go'
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton3: tMSButton
    Left = 360
    Top = 129
    Width = 73
    Height = 25
    Caption = 'Cancel'
    TabOrder = 3
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,DoBrowse
AddDialogHandler>Dialog1,MSButton2,OnClick,RunScript
AddDialogHandler>Dialog1,MSButton3,OnClick,CloseDialog
AddDialogHandler>Dialog1,MSFolderName,OnKeyPress,DoKeyPress
SetDialogProperty>Dialog1,MSButton1,InitialDir,%strLastFolder%
if>%strLastFolder%=Z:\
else
  SetDialogProperty>Dialog1,MSFolderName,Text,%strLastFolder%
endif

Show>Dialog1,dlgResult


User avatar
Dorian (MJT support)
Automation Wizard
Posts: 490
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Error: "Cannot Run Dialog. Not Found"

Post by Dorian (MJT support) » Wed Oct 23, 2019 2:53 pm

It ran fine for me in 14.5.5. It gave me that error as soon as I clicked any buttons, but adding some empty subroutines fixed that. To answer your other question, nothing relating to Dialogs has been changed in 14.5.5.

Code: Select all

let>strLastFolder=Z:\
Dialog>Dialog1
object Dialog1: TForm
  Left = 635
  Top = 307
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Select Folder'
  ClientHeight = 182
  ClientWidth = 476
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object MSFolderName: TEdit
    Left = 27
    Top = 32
    Width = 318
    Height = 21
    TabOrder = 0
    Text = '(Enter Folder Name)'
  end
  object MSButton1: tMSButton
    Left = 360
    Top = 31
    Width = 73
    Height = 25
    Caption = 'Choose Folder'
    TabOrder = 1
    DoBrowse = False
    InitialDir = '%strLastFolder%'
    BrowseStyle = fbFolder
  end
  object MSButton2: tMSButton
    Left = 360
    Top = 79
    Width = 73
    Height = 25
    Caption = 'Go'
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton3: tMSButton
    Left = 360
    Top = 129
    Width = 73
    Height = 25
    Caption = 'Cancel'
    TabOrder = 3
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,DoBrowse
AddDialogHandler>Dialog1,MSButton2,OnClick,RunScript
AddDialogHandler>Dialog1,MSButton3,OnClick,CloseDialog
AddDialogHandler>Dialog1,MSFolderName,OnKeyPress,DoKeyPress
SetDialogProperty>Dialog1,MSButton1,InitialDir,%strLastFolder%
if>%strLastFolder%=Z:\
else
  SetDialogProperty>Dialog1,MSFolderName,Text,%strLastFolder%
endif
Show>Dialog1,dlgResult

srt>DoBrowse
  
END>DoBrowse

srt>RunScript
  
END>RunScript

srt>CloseDialog
  
END>CloseDialog

srt>DoKeyPress
  
END>DoKeyPress
Always accepting custom script commissions. Message me or go here

JoeBly
Newbie
Posts: 4
Joined: Tue Dec 04, 2018 12:29 am

Re: Error: "Cannot Run Dialog. Not Found"

Post by JoeBly » Wed Oct 23, 2019 9:28 pm

OK...it runs now. But here's what happened: I had to kill the process from Task Manager, as it got stuck after the dialog error. When I restarted Macro Scheduler, all 50+ of my scripts had disappeared, and all the track groups read 'ERROR'. It wouldn't import the existing scripts from the script directory, and I had to uninstall/reinstall Macro Scheduler. I then imported the scripts successfully, and now the dialog box works. :| Things happen that we can't explain, I suppose.

Post Reply