Handler problem says can't continue

I have a script but can’t get a handler to work it says can’t continue {}
Can anyone help I am pretty new to this can’t work out what I have done or not done.

tell application “MultiAd Creator Pro”
activate
set theFolder to (folder of document 1) as text
set theName to name of document 1
ad_in()
end tell

on ad_in()
save document 1
set targetPath to “ADVERT:”
set documentName to name of document 1
export EPS spread 1 of document 1 saving in (targetPath & DocumentName)

with timeout of 300 seconds
tell application “MultiAd Creator Pro”
print document 1
end tell
end timeout
end ad_in

Use my

my ad_in()

As jj says, use ‘my’, because it’s the script - not your application - that understands the ‘ad_in()’ command. I’d guess too that ‘document 1’ and ‘export’ belong to the application, so perhaps you should move the ‘tell’ line in the handler:

tell application "MultiAd Creator Pro"
  activate
  set theFolder to (folder of document 1) as text
  set theName to name of document 1
  my ad_in()
end tell

on ad_in()
  tell application "MultiAd Creator Pro"
    save document 1
    set targetPath to "ADVERT:"
    set documentName to name of document 1
    export EPS spread 1 of document 1 saving in (targetPath & DocumentName)   
                           
    with timeout of 300 seconds
      print document 1                                           
    end timeout
  end tell
end ad_in

MY Thanks guys that fixed it
don’t know what I did when editing script but must have deleted Tell “multi ad” line. It is there on the actual full script

Daniel Telfer