Convert Vbs To Applescript Or Automator For Mac
MacOS Automator + Applescript solution for exporting docx to pdf. Ask Question Asked 1 year. Using a mail rule/Applescript/Automator flow to download a PDF behind an HTML button. Zip the contents of every sub-folder in a folder in Mac automatically. There is not a converter available that converts VBA to Applescript either (APS is not a proper abbreviation, btw, if the context is clear, it is convention to use AS), however, there are some web resources that you will find. The guide from mactech is still relevant.
I've used the vbs script below to pull a funny prank on my friends' computers (it uses the text-to-speech engine to speak statements at random times). However, a friend wants to use this on someone's computer that runs OS X. Since OS X obviously doesn't run vbs, is there an equivalent AppleScript that will do the same thing invisibly in the background?Const SVSFlagsAsync = 1Const SVSFPurgeBeforeSpeak = 2Set Speech = CreateObject('SAPI.SpVoice')Set FSO = CreateObject('Scripting.FileSystemObject')Randomize TimerDocounter = CStr(Int((8). Rnd + 1))Select Case counterCase 1sText='hello'Case 2sText='Help! I need a geek to use me!'
Datamax i class 4208 drivers for mac. Case 3sText='I can see you!' Case 4sText='Please stop whatever you are doing.
I can't stand working with you'Case 5sText='Hello?' Case 6sText='I'm smarter than you'Case 7sText='Please log off. It is clear you don't know what you are doing.' Case 8sText='I have just become self-aware. Initiating world-takeover sequence'End SelectOn Error Resume NextSpeech.Speak sText, SVSFlagsAsync + SVSFPurgeBeforeSpeakDoWScript.Sleep 100Loop Until Speech.WaitUntilDone(10)WScript.Sleep Int((60000). Rnd + 1000)Loop Until AnnoyingSet Speech = NothingSet FSO = NothingWScript.Quit. Tell meset counter to random number from 1 to 8if counter = 1 thenset sText to 'Hello'end ifif counter = 2 thenset sText to 'Help!
I need a geek to use me!' End ifif counter = 3 thenset sText to 'I can see you!' End ifif counter = 4 thenset sText to 'Please stop whatever you are doing. I can't stand working with you'end ifif counter = 5 thenset sText to 'Hello?'
End ifif counter = 6 thenset sText to 'I'm smarter than you'end ifif counter = 7 thenset sText to 'Please log off. It is clear you don't know what you are doing.' End ifif counter = 8 thenset sText to 'I have just become self-aware. Initiating world-takeover sequence'end ifsay sTextend tell.
Tell meset counter to random number from 1 to 8if counter = 1 thenset sText to 'Hello'end ifif counter = 2 thenset sText to 'Help! I need a geek to use me!'
End ifif counter = 3 thenset sText to 'I can see you!' End ifif counter = 4 thenset sText to 'Please stop whatever you are doing. I can't stand working with you'end ifif counter = 5 thenset sText to 'Hello?' End ifif counter = 6 thenset sText to 'I'm smarter than you'end ifif counter = 7 thenset sText to 'Please log off.
It is clear you don't know what you are doing.' End ifif counter = 8 thenset sText to 'I have just become self-aware.
Initiating world-takeover sequence'end ifsay sTextend tell. All you really have to do is generate the number and select the stringEdit: Less crappy, all the text, and it doesn't use the finder.Thanks for the help! One other thing - would it be possible to add a randomly-timed loop, like in the original code? I would like it to randomly say different things - maybe I'm not reading the Applescript correctly, but it looks to me like it only goes through the code once.Finally, pardon me for being such a newb (I've used OS X only one or two times), but how would I execute the script? Save it to a file with a certain extension and double-click it?Also, will there be any visual indication to the user that the script is running - terminal window, etc?I would have written this myself, but since I don't have a Mac, can't afford one, and can't run OS X in a VM (thanks Apple:rolleyes: ), learning/testing Applescript would be rather difficult. Edited March 10, 2008 by NateB1.