hexagon logo

Create folder script

It used to be here.
Parents
  • Yes you can. One sec and will post.

    
    'Variables
    Set opname     = PCDPartProgram.GetVariableValue ("OPERATOR")
    Set joname      = PCDPartProgram.GetVariableValue ("JOB")
    Set sampname = PCDPartProgram.GetVariableValue ("SAMP")
    
    'Assignments per Variable Call-Ins
    Fname         = sampname.Stringvalue & " " &  opname.Stringvalue & " "  
    strDirectory  = PCDPartProgram.Path & "\" & "Job Log"
    strFileName = joname.StringValue
    strPath         = strDirectory & "/" & strFileName & ".txt"
    
    ' Create the File System Object
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    'Check For Text File And create If Necessary
    If objFSO.FileExists(strPath) Then
      Set objFile   = objFSO.OpenTextFile(strPath)
    Else
      Set objFile   = objFSO.CreateTextFile(strPath)
        Set objFile = objFSO.OpenTextFile(strPath)
    End If
    
    


    This is an example with a text file. But the folder commands are similar.
Reply
  • Yes you can. One sec and will post.

    
    'Variables
    Set opname     = PCDPartProgram.GetVariableValue ("OPERATOR")
    Set joname      = PCDPartProgram.GetVariableValue ("JOB")
    Set sampname = PCDPartProgram.GetVariableValue ("SAMP")
    
    'Assignments per Variable Call-Ins
    Fname         = sampname.Stringvalue & " " &  opname.Stringvalue & " "  
    strDirectory  = PCDPartProgram.Path & "\" & "Job Log"
    strFileName = joname.StringValue
    strPath         = strDirectory & "/" & strFileName & ".txt"
    
    ' Create the File System Object
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    'Check For Text File And create If Necessary
    If objFSO.FileExists(strPath) Then
      Set objFile   = objFSO.OpenTextFile(strPath)
    Else
      Set objFile   = objFSO.CreateTextFile(strPath)
        Set objFile = objFSO.OpenTextFile(strPath)
    End If
    
    


    This is an example with a text file. But the folder commands are similar.
Children
No Data