Automator and Apple script error handling

BjZ


Joined
Jan 2, 2010
Messages
1
Reaction score
0
Points
1
Hello guys,
I hope you can help me with this.
With Automator I made a task to start a program and after that run a applescript to mount my external hard drive. (don't know anything about scripting, found it on the web)
The task works perfectly when the external hdd can be mounted, but when it's already mounted the task won't close and I have to do a forced quit.
I think there must be something added to the script that it will quit or not run when the hdd is already mounted.

This is the script i'm using:

Code:
do shell script "BDISK=`/usr/sbin/diskutil list | awk '$3==\"MyBook\" 
{print $6}'`;/usr/sbin/diskutil mount $BDISK"
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,609
Reaction score
1,076
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Can't help with that script but I might be able to fix the problem without using that script. Can you tell us a bit more about what the task accomplishes? I thought I had seen an action that solves this problem right away but it stops the workflow if the disk is not mounted
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top