I’ve had a lot of success asking for help on this forum before and I’d be eternally grateful for any guidance.
I use a piece of software called TeamViewer on my clients computers when I am helping them remotely. They usually need to download it from my website, and that’s fine, but then some of them have trouble using the finder to locate and open the application. I’ve created an automator script to email them to simplify this, but unfortunately it’s 19MB big and that’s not feasible.
What I’m looking to do is have a script that will find “TeamViewer QuickSupport” in their Downloads folder and launch it. All of the tutorials I’ve read online require me to write the full path to the App but that won’t work for me because the path is different on each users computer (/users/XXXX/Downloads/TeamViewer QuickSupport — The XXXX part is different on every Mac) So I’m a bit stuck. I’ve googled for hours and am not coming up with much.
Here’s what I did in Automator and I’d like converted to AppleScript to make the file size smaller so I can just email the script to my clients and they can just double-click it right from their email.
As a bonus, sometimes their browser doesn’t unzip the file first (comes in as TeamViewerQS.zip). Would it be possible for AppleScript to search for the TeamViewer QuickSupport application first, if it doesn’t exist, search for the TeamViewerQS.zip, unzip it, then launch it?
And that seems to work no matter where I have the application. I tried saving it as an application and when I go to email it, it’s 15MB large. I guess I just don’t understand why that’s the case when it’s just one line of text. Is there a way to make it smaller?
The snippets below are supposed to be instructive.
set nm to path to application "Finder" as text
--> "Macintosh HD:System:Library:CoreServices:Finder.app:"
tell application "Finder"
set notFound to true
try
set cantGet to path to resource "dontexist.app" as alias
set notFound to true
end try
end tell
set myDnlFol to path to downloads folder from user domain as text
--> Macintosh HD:Users:me:Downloads:"
You’ll find the path to command in all its glamour in the Scripting additions dictionary that is displayed in the Library window of AppleScript Editor.
Thanks so much for this! The one big question I have is that no matter how I write the script and save it as an application, whenever I attach it to an email it turns into a giant file. Even a simple one line script that’s 100kb on my desktop turns into a 15mb file. Is there something I’m doing wrong?
The inflation of size, may happen due to the process of encoding a binary into ascii that must be done to transfer attachment by the mail protocol. (But I found the size of it to be rather large.)