Download from www.xai-corp.net
What it does
This script creates a hotkey which will cause the targeted asteroid or ship to be scanned (provided the relevant scanner is installed and the object is within scanner range). If you use the hotkey to scan an asteroid, its resource type and yield will be displayed at the bottom of the screen. For ships, a message specifying whether the contents are legal or illegal is displayed. A warning is displayed if an illegal scan is about to take place. To scan anyway, press the hotkey again within 2 seconds.
What it does not do
-The ship information screen will not be opened since the purpose of script is purely to scan for illegal wares
-Automate the search for and scanning of asteroids. There are already one or two scripts by other people for that. This is simply a hotkey for use in the ship you're currently piloting.
-Asteroid chunks and rocks (i.e., those not appearing on the gravidar or the sector map) apparently can't be scanned until something has hit them (like a laser). Until then, the game will tell the script that nothing is targeted and you'll get the "Invalid object" message. A simple work-around is to shoot the rock once. Then you'll be able to scan it. This will be corrected in a later version if I find out how.
Installing/Removing
-Install and remove using Cycrow's X-Universe Plugin Manager
-Instructions for running a script to unregister the hotkey (optional) are included in the readme. Just remember to run it BEFORE you uninstall the script

**Change Log**
v1.2
--No longer asks for confirmation if scanning in a sector from whose owner a license is not available (Pirates, Xenon, etc.). My understanding is that these scans are automatically legal in the sense that there isn't any rep loss for scanning without a license in such sectors. In X3R any ship scanned in a pirate sector might turn hostile. I don't know whether this occurs in X3TC.
V1.1
--Added warning when scanning ships w/o a license
--Removed some debugging code I had missed last time
Additional Credit
-Cycrow: for the X-Universe Plugin Manager, his basic scripting guides (here), and some details on the ship-scanning cmd
-s9ilent: for explaining how to find and trigger sound events
-The Xai Corporation: for hosting scripts and their online version of the MSCI-Handbook
-Egosoft: for creating the whole X Universe