applescript

How can I move a window to a target space with Applescript in OS X 10.8?

被刻印的时光 ゝ 提交于 2019-12-23 10:19:46
问题 Ultimately I'm trying to assign hotkeys (via Alfred or Keymando) that can move the frontmost application to any of my spaces. Triggering an applescript seems the most likely route to success. I've looked around a lot and it seems there used to be a way to do this via "spaces preferences" in applescript, but this disappeared in OS X Lion. 回答1: If you’re after a pure AppleScript solution you’re out of luck. As you mentioned the Spaces preference pane is gone. In addition, Mission Control.app

Get full directory contents with AppleScript

◇◆丶佛笑我妖孽 提交于 2019-12-23 07:56:09
问题 I need to get the entire (visible) contents of a folder and its subfolders as a list. Is this possible? 回答1: I'm sure there is a shell command that can do this faster, but here is one way in pure Applescript that gives you total control over formatting what info you would like displayed. property kFileList : {} tell application "Finder" set source_folder to choose folder with prompt "Please select directory." my createList(source_folder) end tell on createList(item_list) set the the_items to

Applescript Copy file to a new folder

℡╲_俬逩灬. 提交于 2019-12-23 07:26:25
问题 I need to create an AppleSript that will copy specified files from one folder to a newly created folder. These files need to be specified in the AppleScript editor so something like: start fileToBeMoved = "Desktop/Test Folder 1/test.doc" newfoldername = "Test Folder 2" make newfolder and name it 'newfoldername' copy 'fileToBeMoved' to 'newfolder' end 回答1: Generally: tell application "Finder" make new folder at alias "Macintosh HD:Users:user:Desktop:" with properties {name:"Test Folder 2"}

Applescript Copy file to a new folder

寵の児 提交于 2019-12-23 07:25:14
问题 I need to create an AppleSript that will copy specified files from one folder to a newly created folder. These files need to be specified in the AppleScript editor so something like: start fileToBeMoved = "Desktop/Test Folder 1/test.doc" newfoldername = "Test Folder 2" make newfolder and name it 'newfoldername' copy 'fileToBeMoved' to 'newfolder' end 回答1: Generally: tell application "Finder" make new folder at alias "Macintosh HD:Users:user:Desktop:" with properties {name:"Test Folder 2"}

Applescript to create set iCal events

孤者浪人 提交于 2019-12-23 06:21:18
问题 I use iCal to kept track of my shifts, the event info is the same three standard shift types and I usually copy and paste them as there's no pattern. I'm trying to work out if theres away using Applescript to speed it up. I'd like to input some dates and shift type have Applescript create the events. I tried to see if I could adapt this for each shift type: Reading iCal info from file to make iCal event eg so I just had a list of dates but I couldn't even get the original to run with out

Applescript: Save Selected Outlook Message as .eml File

為{幸葍}努か 提交于 2019-12-23 06:07:12
问题 Looking for some guidelines or tips on how to save a selected Outlook mail message as a .eml file on my Mac. Is there an easy command for this or do I have to actually write the file using the contents from the selected message? 回答1: Hi this is an extract from a script I use. You just have to save the email to a file. It saves the message as a text file. The reason I do this is I can then Search the text file better with spotlight. If I open the text file in TextEdit I see the raw email. Not

Embed a bash shell script in an AppleScriptObjC application with Xcode

。_饼干妹妹 提交于 2019-12-23 05:46:27
问题 I have attempted to follow the instructions on this post but I am falling short of understanding how some of the posters instructions work. I want to be able to package the app with a prewritten bash script and then execute it, but don't follow from Step 4 onwards. Post writes: 4. Also in your AppleScriptObjC script, add the following where appropriate: property pathToResources : "NSString" -- works if added before script command 5. Where appropriate, also add the following in your

How to Watch Excel File Change While openpyxl Makes Changes

大憨熊 提交于 2019-12-23 05:09:36
问题 I built an iOS app that takes users' inputs then uploads their data as .csv files onto dropbox. Now, I'd like to build a cross-platform desktop app that uses openpyxl and the Python dropbox api to listen for these .csv uploads and then write the data in these .csv files to various .xlsx workbooks. I have no issues with this, except my client wants to be able to watch on their desktop as the excel workbooks change. Whenever I make an assignment with openpyxl, such as... wb = load_workbook(

Applescript: Get absolute path of item in a File > Open window

。_饼干妹妹 提交于 2019-12-23 05:09:05
问题 I'm trying to automate JPEGmini which is not entirely scriptable - the only way to control it is via the "Open" dialog. Repeatedly calling it once per image is extremely slow. Instead I'm trying to to perform a search for .jpg or .jpeg files in the "Open" dialog, so that within that result set I can select the batch of files I want to process and open them in a single pass. (More detail after the code example) -- later within the search results list I get, I want to select these set

Get the installed Safari version using AppleScript or Objective C

青春壹個敷衍的年華 提交于 2019-12-23 05:05:54
问题 How can I check the installed safari version on Mac? I need to provide temporary fix for Safari as my app didn't work on safari 5.0.6 and 5.1. So how can I detect these 2 version of safari... i can find its version using webkit but based on this site: http://en.wikipedia.org/wiki/Safari_version_history Safari 5.0.6 has the similar webkit as the previos version... 回答1: If Safari is running this AppleScript will get the version: tell application "Safari" set safariVersion to version end tell