This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script scp_dialog | |
on cased given mytitle:t, message:m, button:b, myicon:i, givefter:g, type:type, ans:a, mylist:l | |
if type is "default" then default(t, m, b) | |
if type is "default_withicon" then default_withicon(t, m, b, i) | |
if type is "giveafter" then giveafter(t, m, b, i, g) | |
if type is "inputtext" then inputtext(t, m, b, a) | |
if type is "chooselist" then chooselist(t, m, l) | |
end cased | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script call_scp | |
on load_lib_file(f) | |
# load "dialog.scpt" as object | |
load script (alias f) | |
end load_lib_file | |
on path_lib_dialog() | |
# path to "dialog.scpt" of current directory | |
tell application "Finder" | |
set pstr to (path to me) as alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OS X リソースフォークを削除する | |
# for AppleScript at github | |
About file.applescrit | |
file.applescrpt は AppleScript で書かれたコンパイル以前のテキストファイル。 | |
file.scpt はコンパイル済みファイル。 | |
github にfile.scpt を push するとブラウジングできない。従って file.applescrpt を | |
push することになる。file.applescrpt を push する場合の利点について考えてみると。。。 | |
仮に、AppleScript Version が異なるマシンにコピーされた時、コンパイルが通るか通らない |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# -------------------- | |
# backup.rb | |
# Ruby 1.8.7 Mac OS X 10.6.7 | |
# -------------------- | |
require 'pathname' | |
module HomeDir | |
def selectfiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------------------------------- | |
# General user | |
#--------------------------------------------------------------------- | |
myid=`id -u` | |
myd=`date "+%Y-%m-%d-%H-%M"` | |
#------------------------- | |
# Defaults write | |
#------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Admin User | |
#------------------------- | |
myd=`date "+%Y-%m-%d-%H-%M-%S"` | |
# ovverride.plist | |
#------------------------- | |
sudo cat /var/db/launchd.db/com.apple.launchd/overrides.plist > ~/$myd-root-ovverrides.txt | |
sudo lsof -i > ~/$myd-root-lsof.txt | |
# blued |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework "ScriptingBridge" | |
module MyBridge | |
class ITunes | |
attr_reader :lib, :lib_music | |
def initialize | |
@i = SBApplication.applicationWithBundleIdentifier("com.apple.iTunes") | |
@lib = @i.sources[0].libraryPlaylists[0] | |
@lib_music = @playlist = @i.sources[0].userPlaylists[0] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework "ScriptingBridge" | |
# https://gist.github.com/1382271 | |
module MyBridge | |
class RemoveSameSong | |
def initialize | |
i = SBApplication.applicationWithBundleIdentifier("com.apple.iTunes") | |
i.run | |
@filetracks = i.sources[0].userPlaylists[0].fileTracks | |
@h = Hash.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shutdown.scpt | |
# | |
# Mac OS X Lion 10.7.2 | |
# AppleScript's version | |
# => "2.2.1" | |
# application "Finder"'s version | |
# => "10.7.1" | |
## https://gist.github.com/1382281 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# disable bluetooth | |
# OS X 10.8.2 | |
# 2012-10-08 | |
home=$HOME | |
bk=$home/backup-bluetooth-extentions | |
mkdir $bk |
OlderNewer