applescript

Applescript to remove all text not between two strings

邮差的信 提交于 2019-12-08 11:48:47
问题 I'm trying to make a script that displays a dialog of the current iTunes Top 20. How I intend to do this is get the html code from the top 100 website and then extract for text between two strings to get the name of the song. For the first song, this is extremely successful. However, it only works for the first song each time. The only way I can think of to fix this is rather then get everything between the two strings, I could delete everything not between them. This would hopefully then

How to grab HTML snippet via Applescript with Javascript

二次信任 提交于 2019-12-08 11:27:50
问题 Here is my situation in detail. I have figured out how to login to a website, not using javascript, but using "keystrokes", "tabs" and "returns" to find the username and password fields. I know this can be unreliable as websites change but for now I am just trying to keep it simple. After I log in to a site, like a bank account, I want to grab the account balance and import it to Numbers. I have figured out how to insert a predermined text into a specific cell in Numbers and probably could

AppleScript do shell script cURL command for Amazon s3

戏子无情 提交于 2019-12-08 11:12:51
问题 I work exclusively in a Mac OSX environment and I am trying to automate uploading .zip files onto my amazon s3 bucket. I have been trying the last couple of days and I am really stumped. I have tried many different variations of what I will post and I always get the same result of errors. I even tried having my AppleScript call a .sh file and still could not get a result. I am not going to post my whole code just the part where I am doing the cURL command. My string that contains my entire

How to read/modify/remove items/lists contained in a list in applescript

纵饮孤独 提交于 2019-12-08 11:06:47
问题 This question follows on from my previous question How to transform a CSV into several lists (applescript)? I have a csv file with about 4000 lines. I import it and make each line into an item of a list, I then make each line it's own list of items. eg: (I am using numbers but the data I have contains text as well and most of the entries are more than 1 char, some entries are also blank) 1,2,3,4,5,6 6,5,4,3,2,1 7,8,9,0,7,6 3,4,4,5,3,1 becomes {"1,2,3,4,5,6","6,5,4,3,2,1","7,8,9,0,7,6","3,4,4

How do I use applescript to get this checkmark clicked

南楼画角 提交于 2019-12-08 11:01:46
问题 So I would like to use applescript to click the checkmark that says "allow access for all users" in System Preferences then sharing then remote login. As shown in this screenshot: What it should look like if it works Anyways so I've gotten really close to being able to get it clicked but i haven't yet succeeded here is the script that I have so far: tell application "System Preferences" set current pane to pane "com.apple.preferences.sharing" end tell tell application "System Events" tell

How do I launch a particular version of Xcode from Applescript?

最后都变了- 提交于 2019-12-08 09:45:31
问题 I have two versions of Xcode installed, Xcode 3.2.3 and the Xcode4 developer preview. How do I ensure from Applescript that the 3.2.3 version is picked? 回答1: Instead of simply referencing Xcode by its name, i.e.: tell application "Xcode" ... end tell you can also reference a particular version of an application by its full POSIX path, i.e.: tell application "/Developer/Applications/Xcode 3.2.3.app" ... end tell Also see the AppleScript language guide section on the application class. A more

AppleScript - How to send a email without the mail app opening up

允我心安 提交于 2019-12-08 09:39:29
问题 I need to know how to send a email with applescript without having a email to send from. So basically using the mail app is out because I have to have the use input their email in order to send. Could I do a shell script in side the applescript in order to send? 回答1: Try my python email shell script here. I have an example applescript at the bottom of the page showing how you can control the shell script from applescript. 来源: https://stackoverflow.com/questions/8767884/applescript-how-to-send

Applescript to automatically close dialog box after input?

独自空忆成欢 提交于 2019-12-08 09:01:41
问题 Ok, so I am writing an applescript to do some voice control actions for me. I am using Dragon Dictate 2.0 for mac for my voice control and mainly applescript for my coding. I have everything pretty much squared away except for once small issue. When expecting a voice command, I have applescript display a dialog for the text to be dictated into. eg. set cmd1 to the text returned of (display dialog "Speak Command:" default answer "") This displays a dialog box with an empty text field, and the

Show context menu on Mac with keyboard using AppleScript and Automator

落花浮王杯 提交于 2019-12-08 07:54:20
问题 I am trying to find a way to bring up the context menu in Finder on a Mac with Yosemite without touching the mouse/touchpad. A context menu. After extensive research on this issue, the only possible route seems to be using AppleScript with Automator, and assign keyboard shortcut to it. The AppleScript below was found on stackoverflow, if I run it inside the Automator, it would bring up the context menu on one of the files on the desktop (not the file currently selected.) tell application

AppleScript: Script to switch Caps Lock Key to Control

末鹿安然 提交于 2019-12-08 06:51:14
问题 I was trying to find a solution to this because I am using Vim and most of the time I need Caps lock to be assigned to Ctrl. There are times though that I want the Caps Lock working normally. I thought an Apple Script is great as it can be assigned to a LaunchBar action. I will answer with the solution I ended up with (through GUI scripting) but would be interested in a less intrusive solution if someone knows a way... 回答1: You can use PCKeyboardHack to change caps lock to F19. Then save this