applescript

Restrict file types on droplet

ぐ巨炮叔叔 提交于 2019-12-19 10:54:16
问题 This question isn't limited to people who know AppleScript, if you do Cocoa, etc., you should know the answer to this: I'm making a droplet in AppleScript that compresses JavaScript files, so obviously, I only want JavaScript files to be allowed into the scripts. Any ideas? Thanks so much. 回答1: property kJavascriptExtension : "js" property pValidFileList : {} on open of theFiles -- Executed when files are dropped on the script set fileCount to (get count of items in theFiles) repeat with

Applescript to make new folder

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 10:53:17
问题 I Want to make a new Folder command in apple script Why dosent this script work? tell application "Finder" activate end tell tell application "System Events" tell process "Finder" tell menu bar 1 tell menu bar item "File" tell menu "File" click menu item "New folder" end tell end tell end tell end tell end tell 回答1: You can do it more directly with AppleScript: tell application "Finder" set p to path to desktop -- Or whatever path you want make new folder at p with properties {name:"New

Applescript to make new folder

試著忘記壹切 提交于 2019-12-19 10:53:17
问题 I Want to make a new Folder command in apple script Why dosent this script work? tell application "Finder" activate end tell tell application "System Events" tell process "Finder" tell menu bar 1 tell menu bar item "File" tell menu "File" click menu item "New folder" end tell end tell end tell end tell end tell 回答1: You can do it more directly with AppleScript: tell application "Finder" set p to path to desktop -- Or whatever path you want make new folder at p with properties {name:"New

Making AppleScript fill form

天大地大妈咪最大 提交于 2019-12-19 10:52:57
问题 the problem I'm having is making me sick. I'm working over an applescript that throws action to fill form. I think I'm having an issue while getting it to wait until the site is loaded in 100%. The script activates the site but doesn't fill the forms. Please navigate me and help to work out this lazy script: tell application "Safari" set loginurl to "http://www.dogomania.pl/forum/register.php" set mylogin to "worker100" set mypassword to "blackie698" tell application "Safari" make new

AppleScript from Java on Mac OS X 10.6?

心不动则不痛 提交于 2019-12-19 10:16:55
问题 To call AppleScript from Python, I use the "appscript" bridge: http://appscript.sourceforge.net/ What can I use to call AppleScript from Java on Mac OS X 10.6+? 回答1: Here's an approach that works for me for Java on Mac OS X 10.6+. This example script fetches the creation date of the current folder: import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.io.File; import java.util.Date; import java.util.GregorianCalendar;

Open Terminal from shell and execute commands [duplicate]

被刻印的时光 ゝ 提交于 2019-12-19 05:19:33
问题 This question already has answers here : Running a command in a new Mac OS X Terminal window (10 answers) Closed last year . I am lazy so I want to write a shell script to open my dev environment. I setup two commands dev and dev-startup . When I run dev /directory/path it should open a new terminal window at /directory/path and execute dev-startup . I'm not sure how to open the terminal window at a specific directory and then run a final command to run the tools I need to setup the

Applescript API documentation

梦想与她 提交于 2019-12-18 16:58:12
问题 I want to make an AppleScript to automate the task of switching resolution on the MacBook Pro Retina. Searching the internet for "applescript system preferences" I came across a page where some preferences are show. Being the scaled resolution thing new, it is not documented. This brings to a bigger problem I have with AppleScript (mind that apart from copy-pasting something I never really programmed in it). Where is the documentation that tells me, for instance, tha the System Preferences

How do I scroll to the top of a window using applescript?

╄→гoц情女王★ 提交于 2019-12-18 16:49:11
问题 I want applescript to scroll a window all the way up. I've tried the page up key, the home key, and I've tried looking for a way to scroll using the built in scrolling capabilities of the window, but I've so far been unable to even move the scrolled position at all. 回答1: Basically, use a tell app "System Events" statement to send keystrokes and key codes. In theory, you could use the following: keystroke page up key keystroke page down key keystroke home key But for me this doesn´t work. The

What programming language is the most English-like? [closed]

放肆的年华 提交于 2019-12-18 15:32:30
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I'm mainly a Python programmer, and it is often described as being "executable pseudo-code". I have used a little bit of AppleScript,

How to start new conversation in iMessage using AppleScript?

荒凉一梦 提交于 2019-12-18 14:45:08
问题 So I'm working on creating an applescript which essentially automates sending an imessage. What I have working now is: on run {msg, phoneNum} tell application "Messages" set serviceID to id of 1st service whose service type = iMessage send msg to buddy phoneNum of service id serviceID end tell end run This works for the most part except it doesn't work when starting a new conversation. When you run the script to a number which you don't have a conversation with in messages, you get a popup