Re: working with find command
Re: working with find command
- Subject: Re: working with find command
- From: Stan Cleveland <email@hidden>
- Date: Tue, 18 Aug 2015 14:29:06 -0700
>> On Aug 18, 2015, at 16:51 , Die Fledermaus <email@hidden> wrote:
>>
>> I am trying to get this to work
>>
>> set mypath to "/Users/ifbell/Desktop/processedvid/source.mp4"
>>
>> set status1 to do shell script "[ -f " & quoted form of mypath & " ] && echo yes1 || echo no1" as text
>> log status1
>>
>> I only get the output no1 no matter whether the file exists or not. Is this just a fools errand to make this work?
Hi Batman,
Here's the shell code I'd use in that situation. Perhaps it will be of help.
set posixPath to "/Users/stanc/Desktop/Some File.txt"
set itemExists to (do shell script "if [[ -e " & quoted form of posixPath & " ]]; " & ¬
"then echo TRUE; else echo FALSE; fi") as boolean
if itemExists then
-- do something
else
-- do something else
end if
Regards,
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden