New answers tagged

-1

Allow the Script Editor to access Accessibility in System Preferences, & try this script. You should define the application name properly. set MyApps to {"Google Chrome", "Skype", "Finder"} repeat with MyApp in MyApps tell application MyApp activate delay 3 tell application "System Events" to tell process MyApp set value of ...


0

The first thing I personally would do would be to add some delay commands. Then run the code with the delay commands. Sometimes that makes a difference. set ProcName to "AppName" tell application ProcName to activate repeat until application ProcName is frontmost delay 0.2 end repeat delay 0.1 tell application "System Events" tell process ...


0

The simplest way is using the Application's bundle identifier. This can be found from reading the Info.plist file within the application package, or with some simple AppleScript such as: get id of application "TextEdit" This returns com.apple.TextEdit. Then, one could run the following AppleScript: tell application id "com.apple.TextEdit" activate ...


-1

I use the following which works fine but may not meet your needs. I want a user to input a number on the terminal when running my python code. print("Enter a number") num = input()


1

Here is the scripting definition file for the latest version of Transmit, downloaded today from the Panic homepage. Transmit.app AppleScript Terminology Conclusion: Having read through the terminology and running a few brief tests in Script Editor to pass the time in an Apple Store, I highly suspect it is not possible to use AppleScript to select files ...


2

Here is an alternate solution. Not sure if you're aware of this but there's already a keyboard shortcut in Finder, (control + command + N) which creates a new folder containing the selected finder items. This can also be accessed through the contextual menu when right clicking on selected Finder items. This AppleScript code works for me using the latest ...


1

Background: I am having problems with my internet connection and the ISP call centre guy refusing to see a problem. This is key to understanding your problem question. What is the problem exactly that you’re are experiencing? Going into detail here will help you (help us) come up with a solution that addresses your exact problem. From your question, it ...


-1

I haven't used Windows in to many years; however, I understand there is a new Windows 10 feature called Windows Subsystem for Linux. Have a look at Everything You Can Do With Windows 10’s New Bash Shell and How to Install and Use the Linux Bash Shell on Windows 10. Maybe using this feature will enable one to create and zip a bash executable and retain its ...


3

You need to direct the save command to Numbers app... This should work for you. tell application "Numbers" save document 1 in POSIX file "/Users/name/Desktop/Workout.numbers" delay 0.1 close document 1 delay 0.1 quit end tell Or if you want to make the code a little prettier... This should work also. set saveToFolder to path to ...


0

This must have been a bug. As soon as I opened crontab -e when I was initially trying to work on this, it stopped logging. Not sure how or why my initial crontab jobs were erased, but I simply recreated them and everything is fine now.


2

The answers here do not always contain best practices, so if you just want the directory echoed on the screen (even when it contains spaces): #!/bin/bash echo "My Script is being run from here: $(dirname "$0")" If you want it into a variable and want . expanded to the full path, you need GNU Readlink first so: Install homebrew Install GNU CoreUtils: brew ...


3

See the answers on Get the source directory of a Bash script from within the script itself. The accepted one recommends #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" but reading all the answers gives a lot of alternatives (and insights into how shells work).


Top 50 recent answers are included