applescript

POSIX path in applescript from list not opening. Raw path works

倾然丶 夕夏残阳落幕 提交于 2019-12-24 06:57:05
问题 I'm really confused with this one. All I want is the files in the list to open. Here's my codes set FilesList to {"Users/XXXXXX/Documents/07PictureArt-Related/THINGS THAT HELP/Tutorials/artNotesfromFeng.rtf", "Users/XXXXXXXX/Documents/07PictureArt-Related/THINGS THAT HELP"} repeat with theFiles in FilesList delay 0.1 tell application "Finder" to open POSIX file (theFiles) end repeat So, how come THAT won't work, but this will??? tell application "Finder" to open POSIX file "Users/XXXXXX

Applescript to Map Esc to Caps Lock when tapped; Control to Caps Lock when pressed (macOS Sierra)?

妖精的绣舞 提交于 2019-12-24 06:45:43
问题 I am well aware of karabiner-elements which is still in development to enable this key mapping in macOS Sierra. However, at the current moment it doesn't work. My thought is that if I map Caps Lock to Control in Preferences/Keyboard/Modifier Keys that gets me half way there. I have seen some interesting things people have done with AppleScript here. I am hoping there is a simple way to achieve this via AppleScript. Its also worth mentioning that karabiner-elements is capable of swapping Caps

Applescript to (if/then) determine file type and choose correct program to open and print file (within batch sequence)

岁酱吖の 提交于 2019-12-24 06:38:23
问题 I have culled together an applescript with great help from @chuck and other board posts to effectively batch print a list of files exported from filemaker containers to a folder called "print" on my desktop. The problem I'm running into now is some of those container exports are not PDF (its a mix of Jpg, PNG, Tif and PDF) and will not open using acrobat (using preview for the PDF or any other PDF viewer is out of the question for a myriad of reasons)... This problem is effectively shutting

AppleScript: How to return to previous dialog/list?

烂漫一生 提交于 2019-12-24 06:30:20
问题 A fairly basic problem here, but I have no AppleScript experience. Made a list with multiple selections and if/then conditions. Made a selection to display a dialog with one button that takes you back to the list. I know theres no "go to line" in AppleScript, so what would be the best way to do this? The essence of what I want: set A to "smb://XXX" set B to "smb://XXX" set servers to {"A", "B"} set chosen to (choose from list servers with title "Servers" with prompt "Connect to:" OK button

make AppleScript program that listens systemwide for shortcuts

喜夏-厌秋 提交于 2019-12-24 05:05:37
问题 I'd like to create some kind of background process that listens to all keystrokes event and acts consequently (for example does some action if CMD-A is pressed while in Finder.app, or more complex things, like sequences to create shortcuts like in emacs..) But how can I listen to keypresses systemwide on SnowLeopard? I thought of Applescript.. but found nothing.. (I'm good at ruby too, and intended to use rb-appscript actually) thanks! 回答1: If you really want to capture all the keystrokes

make AppleScript program that listens systemwide for shortcuts

可紊 提交于 2019-12-24 05:05:25
问题 I'd like to create some kind of background process that listens to all keystrokes event and acts consequently (for example does some action if CMD-A is pressed while in Finder.app, or more complex things, like sequences to create shortcuts like in emacs..) But how can I listen to keypresses systemwide on SnowLeopard? I thought of Applescript.. but found nothing.. (I'm good at ruby too, and intended to use rb-appscript actually) thanks! 回答1: If you really want to capture all the keystrokes

Open an application in a space using applescripts

让人想犯罪 __ 提交于 2019-12-24 04:47:22
问题 I am trying to create a script that will open an application in a specific "space". So let's say I am on space 1 working in the terminal and then I want to be able to open safari in space 4. Is there a way to do this? I have done some searching and found only ways to set the system profile options. Maybe I should tell you my end goal in case what I am attempting is not possible. I use a laptop and plugin in to multiple stations, home, office, and travel. I want to create different window

How to select speakers for iTunes from applescript

若如初见. 提交于 2019-12-24 04:46:08
问题 I would like to be able to select output sound device for iTunes from a script (any programming language would be ok in fact). For the moment I was able to use UI element scripting to get up to clicking on the button which gives the menu to select the speakers: tell application "System Events" tell window "iTunes" of process "iTunes" set chbtn to first UI element whose help is "Choose which speakers to use." tell chbtn click -- tell menu 1 to get every menu item end tell end tell end tell

Applescript: Get path to .app without opening it

China☆狼群 提交于 2019-12-24 04:33:16
问题 I have the following handler; on getAppPath(appName) try return POSIX path of (path to application appName) on error return "NOT INSTALLED" end try end getAppPath Which when called with eg "ImageOptim" will return "/Applications/ImageOptim.app/". The problem I have is that this opens that application in my Dock, is there a way to get this path string without that happening? Thanks. 回答1: path to is in Standard Additions and it must launch the app to get the return value (with the exception of

AppleScript: Hide/Get process name from app

£可爱£侵袭症+ 提交于 2019-12-24 01:44:48
问题 I want to hide the frontmost app. I know you can hide a process using the syntax: tell application "System Events" set visible of process "..." to false end tell and i know how to get the frontmost app: (path to frontmost application as string) But how do I bridge the two commands together? This will not work: tell application "System Events" set visible of process (path to frontmost application as string) to false end tell 回答1: Try this. tell application "System Events" set frontProcess to