One significant reason I love OSX
#1
One significant reason I love OSX
OSX, being a proper certified UNIX variant, is structured so that all the functionality of the OS is exposed to the GUI and via the shell. Anything you can do in the GUI you can access and execute from shell script and apple script. I'm not too familiar with win7 and 8, but you certainly couldn't as comprehensively as OSX allows in Vista or before. You can't hoodwink me, i was a c++ dev for a long time
I wrote my first apple/shell script yesterday and I'm chuffed anyone can do this with their standard version of OSX
This little ditty will suffix a string token onto all square 1:1 ratio jpeg images so you can easily spotlight search for them. For the record, you can search for width=[no. of pixels] and same for height, but not width=height
I set this up as a service so I can just select the images, 5000 in my case, and execute this.
Brilliant
I wrote my first apple/shell script yesterday and I'm chuffed anyone can do this with their standard version of OSX
This little ditty will suffix a string token onto all square 1:1 ratio jpeg images so you can easily spotlight search for them. For the record, you can search for width=[no. of pixels] and same for height, but not width=height
I set this up as a service so I can just select the images, 5000 in my case, and execute this.
Brilliant
Trending Topics
#8
#9
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
Big fan of Applescript. Used it for many, many years. It is very handy. If you really like it, look at ScriptDebugger a very nice alternative to Apple's Script Editor.
You can, or at least could, use Xcode as well, used to be called Applescript Studio, the idea being that you have your AS code and can use the interface editor in Xcode to create complicated windows and dialogs, as AS only offers very basic dialogs.
I've written very simple to very complex scripts (automation testing of an iOS application - Apple does not provide true unattended automation )
As for your script, you could do this:
You would whack the code you want to execute on each file in the --Per item code section. The idea being, you select a bunch of files and drag and drop them on the script, or you run the script and select the files you want to perform the action on.
If you want some code to handle iterating through folders and processing the files that are found, just shout.
You can, or at least could, use Xcode as well, used to be called Applescript Studio, the idea being that you have your AS code and can use the interface editor in Xcode to create complicated windows and dialogs, as AS only offers very basic dialogs.
I've written very simple to very complex scripts (automation testing of an iOS application - Apple does not provide true unattended automation )
As for your script, you could do this:
Code:
on open (droppediems) maincode(droppediems) end open ----------------------------------------------------- on run set theselectedfiles to choose file with prompt "Select your files" with multiple selections allowed maincode(theselectedfiles) end run ----------------------------------------------------- on maincode(theselecteditems) repeat with anitem in theselecteditems -- Per item code end repeat end maincode
If you want some code to handle iterating through folders and processing the files that are found, just shout.
#11
Big fan of Applescript. Used it for many, many years. It is very handy. If you really like it, look at ScriptDebugger a very nice alternative to Apple's Script Editor.
You can, or at least could, use Xcode as well, used to be called Applescript Studio, the idea being that you have your AS code and can use the interface editor in Xcode to create complicated windows and dialogs, as AS only offers very basic dialogs.
I've written very simple to very complex scripts (automation testing of an iOS application - Apple does not provide true unattended automation )
As for your script, you could do this:
You would whack the code you want to execute on each file in the --Per item code section. The idea being, you select a bunch of files and drag and drop them on the script, or you run the script and select the files you want to perform the action on.
If you want some code to handle iterating through folders and processing the files that are found, just shout.
You can, or at least could, use Xcode as well, used to be called Applescript Studio, the idea being that you have your AS code and can use the interface editor in Xcode to create complicated windows and dialogs, as AS only offers very basic dialogs.
I've written very simple to very complex scripts (automation testing of an iOS application - Apple does not provide true unattended automation )
As for your script, you could do this:
Code:
on open (droppediems) maincode(droppediems) end open ----------------------------------------------------- on run set theselectedfiles to choose file with prompt "Select your files" with multiple selections allowed maincode(theselectedfiles) end run ----------------------------------------------------- on maincode(theselecteditems) repeat with anitem in theselecteditems -- Per item code end repeat end maincode
If you want some code to handle iterating through folders and processing the files that are found, just shout.
Thread
Thread Starter
Forum
Replies
Last Post