Automator to open random file on Windows share I have created through automator the ability to locally open a random file in a specified folder with subfolders.  I cannot figure out how to do this on a networked Windows share. 

I have:


Get Specified Servers = smb://Share/Folder 1
Connect to Servers = it connects
Run AppleScript

tell application "Finder"

    set location to :: -- NOT WORKING!

    set randomFolder to some folder in folder "location"
    open some file in randomFolder
end tell



Any thoughts to what the syntax is for location? Or am I missing the mark completely with these actions? I have tried several variations and nothing works.

Note: there is a space in the location "Folder 1"
The following example Automator workflow works for me:





on run {input, parameters}

    set thisFolder to (item 1 of input as string)

    tell application "Finder"
        set randomFolder to some folder in folder thisFolder
        open some file in randomFolder
    end tell

end run




Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate/needed/wanted. The onus is upon the user to add any appropriate error handling as may be appropriate/needed/wanted.