APSF // script by Carter Scholz // // This script reads a text file of object IDs and from it creates a Plan. // To use it: // 1. Prepare a text file of object IDs, one per line // a. Comment lines are prefixed by // // b. NGC objects need no prefix; their number is enough; e.g. "7789" will be read as "NGC7789". // c. Some less common designations may not be found in Astroplanner's catalogs; be sure you have installed // appropriate catalogs; browse them to see the exact ID format; mind punctuation and leading zeroes; // note that, unfortunately, the catalogs cannot be searched by object NAME // 2. Create a New Plan in Astroplanner. // 3. Run the script; locate and open your prepared text file. // Object IDs found in any installed catalog will be added to the plan. // Catalogs are searched in alphabetical order; the object is copied from the first catalog in which it is found // Object IDs not found will be listed in a window and saved in a text file named "NotFound.txt" in the Astroplanner folder. // Many objects have alternate IDs; a good sky charting program can help find aliases for objects not found. dim list as ListWindow, filein as APTextFile, fileout as APTextFile, objID as string, a as integer, n as integer, s as string list=new ListWindow list.Heading(1)="ID" list.Heading(2)="status" filein=ReadTextFile if filein<>nil then fileout=WriteTextFile("NotFound.txt") n=0 while not filein.EOF objID=filein.ReadLine objID=Trim(objID) a=Asc(Left(objID,1)) s=Left(objID,2) if s="//" then else if (a>=48) and (a<=57) then objID="NGC"+objID CatalogFindID(objID) if nCatalogFound<=0 then n=n+1 list.Cell(n,1)=objID list.Cell(n,2)="not found" fileout.WriteLine objID else call CatalogFound(1).AddToPlan end if end if wend filein.Close fileout.Close end if