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
set exportingNotesList to {} | |
tell application "Notes" | |
set theNotes to its notes | |
repeat with aNote in theNotes | |
set aNoteBody to body of aNote | |
set aNoteName to name of aNote | |
set end of exportingNotesList to {body:aNoteBody, name:aNoteName} as record | |
end repeat | |
end tell |
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
javascript:var%20y%20=%20document.location.href;if%20(y.indexOf(%27google.com/maps/%27)%3E=0)%20{if(y.indexOf(%27/preview/search/%27)%3E=0){var%20query=y.indexOf(%27/preview/search/%27)+16;query=y.substring(query,y.length);var%20x=%27http://maps.apple.com/?q=%27+query;document.location=x;setTimeout(function()%20{document.location=y;},%20900);}else{var%20llDex=y.indexOf(%27/@%27)+2;var%20len=y.indexOf(%27/data%27);if(len==-1){len=y.length;}if((len%3E0)&&(llDex%3Clen)){var%20loc=y.substring(llDex,len);llDex=loc.lastIndexOf(",");len=loc.length-1;if((llDex%3E0)&&(llDex+1%3Clen)){var%20zoom=loc.substring(llDex+1,len);loc=loc.substring(0,llDex);var%20x=%27http://maps.apple.com/?ll=%27+loc+%27&z=%27+zoom;document.location=x;setTimeout(function()%20{document.location=y;},%20900);}}}} |
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
property aVar : missing value | |
if aVar is missing value then | |
set aVar to 0 | |
else | |
set aVar to aVar + 1 | |
end if | |
return aVar |
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
- (NSArray *)referenceLinksInString:(NSString *)contentString{ | |
NSString *wildString = @"*[*]:*http*"; //This is where you define your match string. | |
NSPredicate *matchPred = [NSPredicate predicateWithFormat:@"SELF LIKE[cd] %@", wildString]; | |
/* | |
Breaking it down: | |
SELF is the string you're testing | |
[cd] makes the test case-insensitive | |
LIKE is one of the predicate search possiblities. It's NOT regex, but lets you use wildcards '?' for one character and '*' for any number of characters | |
MATCH (not used) is what you would use for Regex. And you'd set it up similiar to LIKE. I don't really know regex, and I can't quite get it to work. But that might be because I don't know regex. | |
%@ you need to pass in the search string like this, rather than just embedding it in the format string. so DON'T USE something like [NSPredicate predicateWithFormat:@"SELF LIKE[cd] *[*]:*http*"] |
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
tell application "Safari" | |
set selecTxt to (do JavaScript "var x = ''+document.getSelection();x" in current tab of front window) as string | |
end tell |
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
javascript:function%20ipNOW(){var%20d='i'+document.location;document.location=d;}ipNOW();void(0) |
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
delay 60 --number of seconds | |
tell application "Finder" | |
eject disk "Audio CD" ---name of disk to eject (exact same as name in finder sidebar, capitalization included) | |
end tell |
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
BEST (pops up a dialog to enter a search term and then opens that google search in a new tab in whatever browser is default): | |
activate | |
set gSearch to the text returned of (display dialog "Google:" default answer "") | |
set gSearch to "http://www.google.com/search?q=" & gSearch | |
tell application "System Events" to open location gSearch | |
Safari: | |
tell application "Safari" | |
tell front window to set current tab to make new tab |