Permalink
Browse files

added Add to iTunes action

closes #44
  • Loading branch information...
1 parent 8ddcc41 commit 831d86973312e07334ccb3daa869a3bed8b93c04 @mshorts committed Nov 3, 2011
Showing with 28 additions and 3 deletions.
  1. +13 −2 Belvedere.ahk
  2. +13 −0 includes/actions.ahk
  3. +2 −1 includes/gui-rule.ahk
View
@@ -434,6 +434,17 @@ Loop
WinNotify(Message, "Action")
}
}
+ else if (Action = "Add to iTunes")
+ {
+ errcode := addtoitunes(file)
+ if errcode
+ {
+ Log("ERROR: Unable to add file to iTunes", "Action")
+ Message = %Message%Unable to add file to iTunes
+ Notify(Message, "Error")
+ WinNotify(Message, "Error")
+ }
+ }
else
{
Msgbox,,No Action, You've detemerined no action to take.
@@ -561,8 +572,8 @@ SetVars:
NoDefaultNumVerbs = is|is not|is greater than|is greater than or equal|is less than|is less than or equal|
DateVerbs = is in the last||is not in the last| ; removed is||is not| for now... needs more work implementing
NoDefaultDateVerbs = is in the last|is not in the last|
- AllActions = Move file||Move file & leave shortcut|Rename file|Send file to Recycle Bin|Delete file|Copy file|Open file|Print file|Custom|
- AllActionsNoDefault = Move file|Move file & leave shortcut|Rename file|Send file to Recycle Bin|Delete file|Copy file|Open file|Print file|Custom|
+ AllActions = Move file||Move file & leave shortcut|Rename file|Send file to Recycle Bin|Delete file|Copy file|Open file|Print file|Custom|Add to iTunes|
+ AllActionsNoDefault = Move file|Move file & leave shortcut|Rename file|Send file to Recycle Bin|Delete file|Copy file|Open file|Print file|Custom|Add to iTunes|
SizeUnits = MB||KB
NoDefaultSizeUnits = MB|KB|
DateUnits = seconds|minutes||hours|days|weeks
View
@@ -249,3 +249,16 @@ compressFile(file)
}
}
+
+addtoitunes(file)
+{
+ RegRead, MusicLoc, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, My Music
+ itunesfolder := MusicLoc . "\iTunes\iTunes Music\Automatically Add to iTunes"
+ ifExist, %itunesfolder%
+ FileMove, %file%, %itunesfolder%
+
+ if ErrorLevel
+ return ErrorLevel
+ else
+ return 0
+}
@@ -401,7 +401,8 @@ SetDestination:
GuiControl, 2: Hide, Overwrite
GuiControl, 2: Hide, Compress
}
- else if (GUIAction = "Open file") or (GUIAction = "Delete file") or (GUIAction = "Send file to Recycle Bin") or (GUIAction = "Print file")
+ else if (GUIAction = "Open file") or (GUIAction = "Delete file") or (GUIAction = "Send file to Recycle Bin")
+ or (GUIAction = "Print file") or (GUIAction = "Add to iTunes")
{
GuiControl, 2: Hide, ActionTo
GuiControl, 2: Hide, GUIChooseFolder

0 comments on commit 831d869

Please sign in to comment.