When Kirk first appears in TMP, he arrives at Starfleet Headquarters for a brief meeting with Admiral Nogura to get the Enterprise
back. After the meeting, he beams to the floating orbital office adjacent to Enterprise
because the vessel's transporters aren't working and takes a travel pod to the ship.
But why is Scotty there waiting for him? He didn't know that Kirk had been named as Decker's replacement until the latter told him. And as the Enterprise
was in a rush to be ready for her mission, it's not as though he didn't have anything more important to do. So why was he in the office standing around? Was an officer told to greet Kirk but not given a reason? Did Kirk message Scotty before coming to Starfleet HQ so that they could meet there before going to Enterprise
? Even if Scotty didn't know about the change in Kirk's assignment, it's still possible Kirk told him he wanted to see the ship, and Scotty thought he meant that he'd be inspecting the vessel before its voyage.
Does the TMP novelization expand on what Scotty was doing there? Is there additional dialogue that's not in the film? Thanks!