# AfterAction

**URL:** https://www.finalbuilder.com/forums/t/afteraction/1910
**Category:** Discussion
**Created:** [December 2, 2011, 3:31am UTC](https://www.finalbuilder.com/forums/t/afteraction/1910 "2011-12-02T03:31:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [December 2, 2011, 3:31am UTC](https://www.finalbuilder.com/forums/t/afteraction/1910/1 "2011-12-02T03:31:24Z")

</div>

Here is the error message of the afteraction:

Showing prompt for variables dialog  
Set Variables  
Variable i\_MakeDeployFromExistingCompile set to   
  
Success  
Error Executing script : AfterAction  
Microsoft VBScript runtime error  
Invalid procedure call or argument  
Line : 3  
Char : 1  
------------------------------------------------------  
Error in AfterScript : VBScript  
This Action did execute successfully however an error occurred in the AfterAction script.  
&nbsp;

This is the script that I set in the FB:

Dim objDictionary  
Set objDictionary = CreateObject("Scripting.Dictionary")

i\_MakeDeployFromExistingCompile = Replace(i\_MakeDeployFromExistingCompile,".zip","",1,-1,1)

ArrFiles = split(i\_MakeDeployFromExistingCompile,vbNewLine)

Set re = new RegExp  
re.Pattern = "\w{4}-\d+-(.\*?)-(\d+\.\d+\.\d+\.\d+)-(.\*)"  
re.IgnoreCase = true

For each file in ArrFiles  
&nbsp;&nbsp; Set results = re.Execute(file)  
&nbsp;&nbsp; If results(0).SubMatches.Count = 3 Then  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strBranch = results(0).SubMatches(2)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not (objDictionary.Exists(strBranch)) Then  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objDictionary.add strBranch, ""  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If  
&nbsp;&nbsp; Else  
&nbsp;&nbsp;&nbsp; Wscript.Echo "Unable to get branch from: " & file  
&nbsp;&nbsp;&nbsp; Wscript.Echo "Please fix, Mr. Due"  
&nbsp;&nbsp; End If  
Next  
e\_TFSListOfBranches = join(objDictionary.Keys, ";")

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 2, 2011, 3:58am UTC](https://www.finalbuilder.com/forums/t/afteraction/1910/2 "2011-12-02T03:58:00Z")

</div>

Not sure why you are posting this here, this is not a FinalBuilder problem, it’s a bug in your script. You are not checking that you actually get any results back, the error is on this line :   
  
 If results(0).SubMatches.Count = 3 Then   
 ^^^^^ fails when you get no matches.
