Announcement

Collapse
No announcement yet.

Any suggestions on improving this action?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Any suggestions on improving this action?

    <IR_ACTIONS_LIST>
    <Action name="Get Default Viewer">
    <Type>13</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%pdfviewer%</Variable>
    <FileExtension>.PDF</FileExtension>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%pdfviewer% = 0</Condition>
    </Action>
    <Action name="Open">
    <Type>7</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>%SrcDir%\pdf\main.pdf</FileName>
    <Verb>open</Verb>
    <WorkingDir/>
    <RunMode>0</RunMode>
    </Action>
    <Action name="ELSE">
    <Type>206</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Acrobat Reader Not Found</DialogTitle>
    <DialogMessage>Acrobat Reader doesn't appear to be installed on your PC. To read this file, Acrobat Reader will need to be installed.</DialogMessage>
    <Icon>3</Icon>
    <Variable>%acroResult%</Variable>
    <DialogType>2</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%acroResult% = 0</Condition>
    </Action>
    <Action name="Execute">
    <Type>8</Type>
    <Function>0</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>%SrcDir%\AcrobatReader\ar505enu.exe</FileName>
    <CommandLine/>
    <WorkingDir/>
    <RunMode>0</RunMode>
    <WaitForReturn>1</WaitForReturn>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    </IR_ACTIONS_LIST>
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  • #2
    Re: Any suggestions on improving this action?

    Yep. Your code won't work properly...you have the cases reversed, and testing for "0" isn't doing what you wanted at all.

    Try it more like this:

    <IR_ACTIONS_LIST>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Set a default value for our test</Comment>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%pdfviewer%</Variable>
    <Value>NOTFOUND</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Note: I've set the On Error user notification to "none" for the next action</Comment>
    </Action>
    <Action name="Get Default Viewer">
    <Type>13</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>0</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%pdfviewer%</Variable>
    <FileExtension>.PDF</FileExtension>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%pdfviewer% = "NOTFOUND"</Condition>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Acrobat Reader Not Found</DialogTitle>
    <DialogMessage>Acrobat Reader doesn't appear to be installed on your PC. To read this file, Acrobat Reader will need to be installed.</DialogMessage>
    <Icon>3</Icon>
    <Variable>%acroResult%</Variable>
    <DialogType>2</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%acroResult% = "OK"</Condition>
    </Action>
    <Action name="Execute">
    <Type>8</Type>
    <Function>0</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>%SrcDir%\AcrobatReader\ar505enu.exe</FileName>
    <CommandLine/>
    <WorkingDir/>
    <RunMode>0</RunMode>
    <WaitForReturn>1</WaitForReturn>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="ELSE">
    <Type>206</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Open">
    <Type>7</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>%SrcDir%\pdf\main.pdf</FileName>
    <Verb>open</Verb>
    <WorkingDir/>
    <RunMode>0</RunMode>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    </IR_ACTIONS_LIST>
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: Any suggestions on improving this action?

      Lorne,

      Thanks for the help. Now my question is about the response I should receive from the File.GetDefaultViewer (.PDF) action. I see that you set it to %pdfviewer%="NOTFOUND' for a test. Is this the typical response I should expect to see when I do this test? This is where I am confused about what values are expected to be returned. Five options are listed 0-4 with 0 being (OK). Are these not the values you want to use in setting up the test?

      In working with dialog boxes, is the result that is returned "OK" or "YES" or "NO". Or are there values that are assigned to these. I am assuming it is the first based on the actions you defined.

      Lastly, if I am not sure of the value that is being returned is there a way for me to run the application and open the variable to see what is returned?

      Thanks
      TJ-Tigger
      "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
      "Draco dormiens nunquam titillandus."
      Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

      Comment


      • #4
        Re: Any suggestions on improving this action?


        I see that you set it to %pdfviewer%="NOTFOUND' for a test. Is this the typical response I should expect to see when I do this test?
        No. Those are the error codes that will be stored in the special built-in variable %LastErrorNum% if that action fails.

        You could test it that way, too, by doing %LastErrorNum% = 0 or whatever.

        If an action fails, it doesn't even touch the variable you specify for the return value. In my edited version, I set the variable to a "default value" first, and then check to see whether it was changed from that default value, as another way of finding out if the action failed (instead of testing %LastErrorNum%).


        In working with dialog boxes, is the result that is returned "OK" or "YES" or "NO". Or are there values that are assigned to these.
        Okay, go RTFM. [img]/ubbthreads/images/icons/smile.gif[/img] This is explained in the docs for that action.


        Lastly, if I am not sure of the value that is being returned is there a way for me to run the application and open the variable to see what is returned?
        Just use the variable in a message box so you can see what its current value is. (A common programming technique.)
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Re: Any suggestions on improving this action?

          Thanks for the help. RTFM = Read the free manual? (teehee) I am a technical Instructor and use RTFM in my class as a "when all else fails . . . " statement, but to keep it "PC" I use the above definition.

          Contrary to Popular Belief, I do attempt to find the answers in the manual but I don't search for too long of a period. I did find the answer to the above question however.

          I am still a little lost on how to use the actions above to accurately determine the presence of AcroRead on a users system. I will keep working with it to see what I can find. If anyone has a working action list and wouldn't mind sharing it I would appreciate it. Also, for those who have the ClicknLearn CD how do they go about detecting if AcroRead is installed? Does anyone have the actions list they built?

          I can't wait for AutoPlay Zone to be completed.
          TJ-Tigger
          "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
          "Draco dormiens nunquam titillandus."
          Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

          Comment

          Working...
          X