![]() |
Quote:
You should forget about doing the mounting until you can reliably get the AppleScript to get invoked. Note also that it is possible to invoke AppleScript from a Bash script. See the examples in my Unix FAQ (top of the Unix beginner section of these forums) Quote:
|
Actually I have a Sandisk Titanium which did have the U3 software. When I was looking into it, most of the ones with encryption only worked on Windows not Mac OS. Plus I preferred the sturdiness of the titanium over the encryption feature (it also occurred to me to encrypt after I had purchased my flash drive.)
Using a DMG works fine for my needs. I admit to being lazy but if I can get the DMG to mount, my next step is going to be to mount the image and then launch my mail and IM software which both need the DMG to be mounted to work correctly (this is by my choosing). I actually have an applescript that will do all three steps. The only thing I have not been able to do is automatically recognize the insertion of the flash drive. If I compile the script as an application and put it in my dock, then I can actually achieve a substantial savings in startup steps to get me going. So at this point it has moved more into the realm of learning how to do this specific set of tasks rather than lacking a workable solution. The plist file and script do seem to work on occasion. I just can get them to consistently work together correctly. I know at least 3 times today that the scripts worked as intended. Unfortunately, at least as many times they did not. |
Hayne, thank you again for the help.
|
Hayne, if I may impose oncer more upon you. Since i had success with the basic shell script, I thought I might have better luck if I do all the things I want in a shell script rather than an apple script
So this is the AppleScript I want to convert to shell script: try do shell script "hdiutil mount '/Volumes/CRUZER/private.dmg'" set launchApps to "true" on error set launchApps to "false" end try if launchApps is not "false" then tell application "Microsoft Entourage" to activate tell application "Portable Adium" to activate end if Would the following work as it's replacement? #!/bin/bash if hdiutil mount '/Volumes/CRUZER/private.dmg' insert commands to launch apps else exit 1 If the basic framework is correct, is there an equivalent command to tell application to activate for bash? I tried looking at several bash related websites and some google searches and could not find it. But in truth, i have no idea what it might be called so that makes it harder to search. |
I just recently wrote a shell script that date stamps a HTML page for bloggers and web developers to quickly make blank date stamped HTML pages. I used this code to date stamp things, you would have to output the shell script into an application though.
Code:
#!/bin/bashCode:
sh /path/to/script | open -f -t (will open it in the OSes default text editor) |
Thanks, but I can get a time date stamp easily in a shell script using the suggestion by Hayne above. What I was looking for was a way through an applescript since that is where my problem seems to lie. However, right now that is on the backburner if I can find a way to launch a Mac application directly from the shell script.
|
To merely launch an application from the command-line (or from a shell script), you can use the 'open' command - read 'man open'.
You want to use the "-a" option to tell it to run an app (as opposed to opening a document) =- something like: open -a "Microsoft Entourage" |
Excellent. thanks so much.
|
drmoque,
At first, I thought you wanted the dmg to mount on any machine automatically, which I don't believe can be done. But now that you're going down the scripting, you are certainly going to limit this behavior to specific machines--the one's that are running the scripts and launchagents. So since you're going that route, why not forget about all of the scripting and just use Do Something When? |
chabig,
When I started this journey, I was looking to do something to the DMG that would indeed launch on any machine. When that seemed improbable I backed down to something I could do on machines that I use frequently and had a user account. In fact the desire to launch my mail and IM programs after mounting the encrypted DMG were part of what I would call the evolution of my needs and desires. I believe Do Something Now will probably do exactly what i need if I can mount the DMG file using the hdutil command. I am certainly going to download it and try it out to see if it can. Thank you for the suggestion, I had no idea of its existence. |
To all who have responded to this post, Thank you.
Do Something Now seems to have done the trick. It is not my ideal solution since it only works on machines where DSN is installed but for me it will be close enough. At least on machines I can control and trust, it does exactly what I needed to do. |
| All times are GMT -5. The time now is 05:51 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.