home *** CD-ROM | disk | FTP | other *** search
- on HANLaunchACRO
- global HANAcroAlOption, HANACRORunning, DriveLtr
- set theApp to getExtensionApp("PDF")
- if word 1 of theApp = "Error:" then
- set HANAcroAlOption to 1
- put "do not have acrobat on your machine"
- HANACROAlertUser()
- else
- put theApp into field "HANLocation"
- set FirstSlash to 0
- repeat with t = 1 to the number of chars in field "HANLocation"
- if char t of field "HANLocation" = "\" then
- if FirstSlash = 0 then
- set FirstSlash to t
- next repeat
- end if
- set LastSlash to t
- end if
- end repeat
- set folderLoc to char FirstSlash + 1 to LastSlash - 1 of field "HANLocation"
- set letterN to char FirstSlash - 2 of field "HANLocation"
- set NumOf to the number of chars in field "HANLocation"
- set Exename to char LastSlash + 1 to NumOf of field "HANLocation"
- repeat with t = 1 to 200
- set fname to getNthFileNameInFolder(letterN & ":\" & folderLoc, t)
- if fname = EMPTY then
- put "not found"
- set fname to 0
- exit repeat
- end if
- if fname = Exename then
- put "executable found"
- set fname to 1
- exit repeat
- end if
- end repeat
- case fname of
- 0:
- set HANAcroAlOption to 2
- put "acrobat not where it should be"
- HANACROAlertUser()
- 1:
- repeat with t = 1 to the number of chars in Exename
- if char t of Exename = "." then
- set HowMany to t
- exit repeat
- end if
- end repeat
- set shortexename to char 1 to HowMany - 1 of Exename
- put "shortexename", shortexename
- set tasklistStore to gMasterAppObject(mGetTaskList)
- repeat with t = 1 to the number of lines in tasklistStore
- set taskLinet to line t of tasklistStore
- put "taskLinet", taskLinet
- repeat with d = 1 to the number of chars in taskLinet
- if char d of taskLinet = "," then
- set HowMany to d
- exit repeat
- end if
- end repeat
- set tasknamet to char 1 to HowMany - 1 of taskLinet
- if tasknamet = shortexename then
- set HANACRORunning to 1
- exit repeat
- end if
- end repeat
- case HANACRORunning of
- 1:
- set HANACRORunning to 0
- put " acrobatrrunning"
- HANLaunchAlert()
- 0:
- put "acrobatnotrunning"
- HANLaunchAlert()
- end case
- end case
- end if
- end
-