Getting the file name for a full path: I use a SelectFile command that lets the user select a PDF file:

SelectFile name="pdffile" filter="*.pdf" title="Select PDF file " directory="..."

This returns the full file name including the directory, but in my script I need the file name without directory. What is the best way to do this?

If you are using GuiXT Controls I suggest you call a VB.NET function where you use "Path.GetFileName". Without GuiXT Controls you can use the following coding:

// extract filename
Set V[i] 1
Set V[k] 1
Set V[n] "&V[pdfile]"  -stringlength

label scan1
  Set V[char] "&V[pdfdatei] (&V[i]-&V[i])"
  if V[char=\]
    Set V[k] &V[i] + 1
  endif
  Set V[i] &V[i] + 1
  if V[i<&V[n]]
    goto scan1
  endif

Set V[filename] "&V[pdfdatei](&V[k]-&V[n]) "

// Test message
message "&V[filename]"