# get-lines

Returns the content of a Lua script source file, or the content of the file between the specified lines.

NOTE: For security reasons, you can not get the content of a script unless the script has been loaded by the server. If you attempt to get the content of a script that has not been loaded, the server returns the error "Source file ... has not been loaded".

    /action=luaDebug&command=get-lines[&file=File]
                                      [&first=First_Line]
                                      [&last=Last_Line]
                                      [&session=SessionID]

Type: Synchronous

Parameter Name | Description | Required
--- | --- | ---
`File` | The name of the file that you want to view. You can use an absolute or relative path. Relative paths are relative to the Objective Connector installation folder. | Required if the `Session` argument is not set.
`First` | The line number of the first line to view. | No
`Last` | The line number of the last line to view. | No
`Session` | Instead of specifying the `File` argument, you can specify a session ID. In this case, the `get-lines` command returns the content of the file that contains the current function. If you set this parameter and do not specify the `First` and `Last` arguments, the server returns the section of code immediately around the current line (7 lines before the current line, and 7 lines after the current line). | Required if the `File` argument is not set.

## Example

    http://localhost:7000/action=LuaDebug&command=get-lines&file=scripts/script.lua&first=1&last=4

## Response

    <autnresponse xmlns:autn="http://schemas.autonomy.com/aci/">
      <action>LUADEBUG</action>
      <response>SUCCESS</response>
      <responsedata>
        <data>
          <command>get-lines</command>
          <file>scripts\script.lua</file>
          <lines first="1" last="4">
            <line-1>function handler (document)</line-1>
            <line-2>-- A Lua script that adds a field to a document</line-2>
            <line-3>document:addField("A_FIELD","A_VALUE")</line-3>
            <line-4>return true</line-4>
          </lines>
        </data>
      </responsedata>
    </autnresponse>

_FT_HTML5_bannerTitle.htm