Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set home_path to (path to home folder as text)
- set hiddenFile to home_path & ".test"
- tell application "Finder"
- if not (exists file hiddenFile) then
- display dialog ".test does not exist."
- end if
- end tell
- #!/bin/bash # define the shell, not really needed because bash is the default shell but good practice
- cd /path/to/search/directory # cd to the proper place
- ls -a | grep "the text you're looking for" # list all files (including hidden ones) and pipe output into grep, a search tool
- chmod +x /path/to/findFile.sh
- set output to do shell script "/path/to/findFile.sh"
- set home_path to (path to home folder as text)
- set hiddenFile to home_path & ".test"
- tell application "System Events"
- if not (exists file hiddenFile) then
- display dialog ".test does not exist."
- else
- display dialog ".test does exist."
- end if
- end tell
- set home_path to (path to home folder as text)
- set fileName to ".viminfo"
- set hiddenFile to home_path & fileName
- tell application "Finder"
- if not (exists file hiddenFile) then
- try
- set output to do shell script "[ -f " & quoted form of POSIX path of hiddenFile & " ];"
- on error
- display dialog fileName & " does not exist."
- end try
- display dialog fileName & " does exist."
- end if
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement