New build of AfterGRASP is up for download:

http://www.aftergrasp.com/download/

agsetup_20100902.exe

----------------------------------------------------------------------------
Thu, 02 September 2010

New command FILEGETTYPE, returns a string with the filetype, or "" if
type not recognized.  The type is determined by the file header, not
by the filename.

Types recognized:

  ico   
  bmp   
  pic   
  gif   
  tiff  
  png   
  emf   
  wmf   
  jpeg  
  pdf   

If no file types match, it tries skipping the first 128bytes to compensate
for MacBinary headers.


 Example:

  drawclear white
  beginloop
  local testimage fileopendialog("Select Image File")
  local type filegettype(@testimage)
  local types array(jpeg,gif,tiff)
  if arraysearch(&types,@type)->size
   messagebox "Valid Image" @quo...@type$@quote
  else
   messagebox "Not a Valid Image" @quo...@type$@quote
  endif
  endloop


Test script I used to copy any invalid files to a test directory for
examination to verify the FILEGETTYPE code. It creates a
RESULTS.CMD which when run copies all the failed files into
"C:\TEST".

  checkdir:
  drawclear white
  filedelete results.cmd
  beginloop
  local p "\\\\192.168.2.140\\Photos\\"
  for fn in drivefilelist(0,@p$"*")
  local type filegettype(@p...@fn)
  if strlen(@type)==0
          filesendln results.cmd "copy "$...@quote$@p...@fn$@quote$" c:\test"
  endif
  next
  exit




----------------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"aftergrasp" group.
To post to this group, send email to aftergr...@googlegroups.com.
To unsubscribe from this group, send email to 
aftergrasp+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/aftergrasp?hl=en.

Reply via email to