script used when scanning on mac with a local scanner