Hi Charlie

Ah, yes, apologies I didn't say -- applescript (the script was appended). Unfortunately my knowledge of perl consists of peering at what you wrote and thinking 'wow'.

And given how poor I am at Applescript, I don't think you want me to learn perl...;)


On 23 May 2014, at 0:28, Charlie Garrison wrote:

4) (*this is the bit I can't get to work*) The script checks whether a file already exists -- I don't want to overwrite anything that exists by mistake.


You don't say what sort of script, or if you did I missed it. But in shell and perl, the idea is the same, you are doing a 'file test'. In perl it would be something like:

if (! -e $path_var) { # does file exist

# create file
}
## or this if perms are an issue
if (! -r $path_var) { # can I read a file
# create file
}

There is similar syntax for shell commands.

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to