{"identifier":41778,"topic":"Commands","name":"open","text":"<code><pre>open <i>application<\/i>\nopen <i>fileName<\/i> with <i>application<\/i>\n<\/pre><\/code> The<code> open <\/code>command launches another application program or opens a document with another application from within HyperCard. You must provide the full path names for the files if they\u2019re not at the same directory level as HyperCard. <br><br>\n\n Under the Finder in System 6, HyperCard sends the<code> suspend <\/code>system message to the current card before turning over control to the application. <br>\n<br>\nIf HyperCard can\u2019t find the document or application, it displays a directory dialog box and asks the user to find it. HyperCard also sets<code> the result <\/code>to<code> Cancel <\/code>if the user clicks Cancel in the dialog box. Otherwise, it sets<code> the result <\/code>to<code> empty<\/code>. <br><br>\n\n If HyperCard has problems opening the specified application (for example, there\u2019s not enough memory), it sets<code> the result <\/code>to<code> \"Couldn't open that application.\"<\/code> <br>\n","related":{"11943":null,"41996":"open file"},"examples":"open \"TeachText\"\nopen \"Read Me\" with \"Teach Text\"\nopen \"the document you want\" with \"the application\" -- invoke dialog box\n\nanswer file \"Start what application?\" of type application\nif it is not empty then open it","demo":"on mouseUp\n   -- this demo only works with System 7 \n   if not systemSeven() then exit mouseUp\n   -- asks the user for an application\n   put askForApplication() into appName\n   if appName is empty then exit mouseUp\n   <b>open<\/b> appName -- open the selected application\n   wait 5\n   <b>open<\/b> the long name of HyperCard -- bring HyperCard to front\n   wait 30\n   close appName -- close the just opened application\n end mouseUp\n <br><br>\n\n function askForApplication\n   answer file \"Select an application to open:\" of type \"APPL\"\n   if it is empty then return empty\n   if it is the long name of HyperCard then\n     -- the user selected the current running HyperCard\n     answer \"Try selecting an application other than HyperCard.\"\n     return askForApplication() -- recursion\n   else return it\n end askForApplication\n <br><br>\n\n function systemSeven\n   return the systemVersion \u2265 7.0\n end systemSeven\n ","debug":{"9":["open application\rope"],"10":["If HyperCard can\u2019t"]}}