Open a Folder

This process will open the “MyPictures” folder.

Folder.GetSpecialFolder SpecialFolder:Folder.SpecialFolder.MyPictures \
                        SpecialFolderPath=> SpecialFolderPath

System.RunApplication ApplicationPath:'explorer' \
                        CommandLineArguments:SpecialFolderPath \
                        WorkingDirectory:'' \
                        WindowStyle:System.ProcessWindowStyle.Normal \
                        ProcessId=> ProcessId

Display.ShowMessage Title:'Example Completed!' Message:'Example "Open a Folder" completed.' \
                        Icon:Display.Icon.None Buttons:Display.Buttons.OK \
                        DefaultButton:Display.DefaultButton.Button1 \
                        IsTopMost:False \
                        ButtonPressed=> ButtonPressed

In more detail:


The process will retrieve the actual location of the “My Pictures” special folder and then open the folder through Windows Explorer. In the end, a message will be displayed to inform the user that the process is completed.

Step 1: Get Path to Windows Special Folder

Retrieve the path to the “My Pictures” folder.

Folder.GetSpecialFolder SpecialFolder:Folder.SpecialFolder.MyPictures \
                        SpecialFolderPath=> SpecialFolderPath

Use the “Folder.GetSpecialFolder” action and change the default value of the “SpecialFolder” argument from “Folder.SpecialFolder.DesktopDirectory” to “Folder.SpecialFolder.MyPictures”.  

Step 2: Run Windows Explorer

Open the folder through Windows Explorer.

System.RunApplication ApplicationPath:'explorer'  \
                        CommandLineArguments:SpecialFolderPath \
                        WorkingDirectory:'' \
                        WindowStyle:System.ProcessWindowStyle.Normal \
                        ProcessId=> ProcessId

Use the “System.RunApplication” action:

  1. Set the “ApplicationPath” argument to “‘explorer’”.
  2. Set the “CommandLineArguments” argument to “SpecialFolderPath”, which is the output variable of the previous action.

Step 3: Display a message when the process is completed

Inform the user when the process is completed.

Display.ShowMessage Title:Process Completed!' \

                        Message:'Process "Open a Folder" completed.' \
                        Icon:Display.Icon.None \
                        Buttons:Display.Buttons.OK \
                        DefaultButton:Display.DefaultButton.Button1 \
                        IsTopMost:False \
                        ButtonPressed=> ButtonPressed

Use the “Display.ShowMessage” action

  1. Set the “title” argument to “Process Completed!”.
  2. ii. Set the “Message” argument to “Process ‘Open a Folder’ completed”.