AnsweredAssumed Answered

For Windows, Send Event; For OS X, Applescript To search Computer Hard Drive

Question asked by rouelf on Apr 5, 2016
Latest reply on Apr 5, 2016 by rouelf

Here is a challenge for those versed in Windows Command Line and Applescript usage:

A script to work in Windows and OS X, that searches the local hard drive for a specified “Filename”, and return the path of the Filename to a variable. For windows probably need to use “Send Event”; for OS X probably need to use AppleScript. Maybe look Something like:

 

# ———— Check if the current platform is Mac

If [ Get ( SystemPlatform ) = 1

Perform Applescript [ ……….. ]

Set Variable [ $Filename_Path ; Value: ……. ]

 

# ———— Check if the current platform is Windows

Else If [ Get ( SystemPlatform ) = -2 ]

Send Event [ ………. ]

Set Variable [ $Filename_Path ; Value: ……. ]

End If

 

# ———— Not Found

If [ $Filename_Path = “” ]

Show Custom Dialog [ “File Not Found” ; “File Not Found” ]

End If

 

Much Appreciated !!

Outcomes