applescript

Applescript Droplet - Export Image Resolution of All Files in Folder/Subfolder as text file

时间秒杀一切 提交于 2019-12-23 04:50:17
问题 I'm probably making a simple error but I can't seem to get my code to work properly. Figure I'd ask the geniuses on this site for help. I'm a novice scripter, more like code piecer. This is my first post, please be gentle. What I'm trying to do... I have a folder (and subfolders) full of images. I'd like to have a applescript droplet that I can drag this folder on this droplet to get a text file report of the resolution and path of that image. This way I can insure my files are all the same

How do I get the path to the file of an open window of an application?

这一生的挚爱 提交于 2019-12-23 04:47:52
问题 I want to write an AppleScript which creates a new file in the same directory as the file I currently have open (in this case, in the application TexShop). If I can get the path, then I can write a script like: set thePath to get path to open window / tell TexShop to get path...? set response to display dialog "Some text:" default answer "" set toWrite to text returned of response tell application "Finder" to set newFile to make new file at thePath set openFile to open for access file

Apple script - make targeted window always on top

廉价感情. 提交于 2019-12-23 04:23:02
问题 I am trying to write an apple script that when executed, will make the currently focused window "always on top". Is this possible? In objective-c I can do this on windows my process owns by using [NSWindow setLevel:] but my struggle is to do it for windows my process does not own. So I am now trying to do it via apple script. I tried this: global frontApp, frontAppName, windowTitle delay 3 set windowTitle to "" tell application "System Events" set frontApp to first application process whose

osacompile changing the AppleScript output so it won't run

送分小仙女□ 提交于 2019-12-23 04:00:11
问题 I have a semi-long AppleScript that I run each morning to launch all of my apps etc. One of the things that it does is launch a few apps and then immediately minimize them. When I paste the .applescript source into Script Editor and run it, everything works fine: -- snip: tell application "Mail" launch minimize(window 1) of me check for new mail end tell -- 'minimize' defined as: on minimize(w) set the miniaturized of w to true end minimize But when I compile the AppleScript source as follows

Applescript: Check if computer is playing any sound

早过忘川 提交于 2019-12-23 03:51:40
问题 Trying to find a way for my script to check if there's any sound/audio being played currently on the computer. And if so, is there any way to find which app is playing sound? 回答1: Maybe this helps: One thing that happens when a sound is played is that the power management blocks the computer to go to sleep. With pmset -g you can see all the Power Management stuff that is going on. So, when sleep is prevented by "coreaudiod" the machine is playing obviously some sound. Here what pmset -g spits

Tap AppleEvents being sent to another application

南楼画角 提交于 2019-12-23 03:47:08
问题 Is it possible to monitor or tap the stream of Apple Events being sent to a process, in the same way you can tap Quartz Events? I have an application that talks to another application to force it to import files, but it does so in a way that's unavailable through menus or UI scripting, and I'm trying to track down how it does this. 回答1: Do you need to do this programmatically or is manual/interactive OK? If manual is OK, here are some approaches: Try using AppleScript Editor to record the

XCode 5 - AppleScript - How to get document in current tab

Deadly 提交于 2019-12-23 03:14:17
问题 I want to open a document in the current tab in an external application (MacVim for example). Based on a StackOverflow answer I created an Automator service with following AppleScript code: tell application "Xcode" set current_document to last source document set current_document_path to path of current_document end tell tell application "MacVim" activate open current_document_path end tell The issue is, that it opens the file from the first tab and not from the current tab. How can I get the

XCode 5 - AppleScript - How to get document in current tab

允我心安 提交于 2019-12-23 03:14:03
问题 I want to open a document in the current tab in an external application (MacVim for example). Based on a StackOverflow answer I created an Automator service with following AppleScript code: tell application "Xcode" set current_document to last source document set current_document_path to path of current_document end tell tell application "MacVim" activate open current_document_path end tell The issue is, that it opens the file from the first tab and not from the current tab. How can I get the

How do I determine whether Growl is running using AppleScript?

跟風遠走 提交于 2019-12-23 02:58:32
问题 I the past, in order to determine whether the Growl helper is running on macOS, I've used tell application "System Events" set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 end tell But recently, both this and an alternative thats been suggested tell application "System Events" to set isRunning to exists (processes where name is "com.Growl.GrowlHelperApp") just run forever. This seems to happen (only) when it (or more precisely the app

Automator to Applescript for Editing Code

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 02:22:14
问题 Just wondering if I can convert a "watch me do" event in Automator to applescript and then edit the resulting code? I've got a recording of entering a query (i.e. Apple1) into Google, but I'd like the query to increase ++ for each loop of the recording, so the result is Apple1, then the next loop would be Apple2, Apple3, etc. I know increments are elementary in programming, but I'm just not sure how to do it using Automator and/or applescript. Any help would be greatly appreciated. 回答1: It