Jump to content

Colin

Member
  • Posts

    26
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Colin

  1. Found the problem. There is a checkbox in Automation that was unchecked. checked it and now it works again.

    Wonder how it got unchecked and also wonder why other system commands worked when it was unchecked.

     

    Maybe the Alfred update a couple of days ago did it????

  2. I can put my iMac (intel,which is up to date), to sleep from the menu bar but does not work through Alfred. All other system commands work.

    Sleep Displays works okay but not Sleep

    Everything was ok a few days ago and I just noticed it today. Uninstalled Alfred and reinstalled the latest version and activated my Powerpack but it has not resolved the issue.

    Can someone please point me in the right direction to get it fixed?

  3. Okay, think I fixed it. Used a VPN from UK and was able to download it.

    Then I tried VPN with another server in Australia and that worked too.

    My ISP must have changed some setting that prevents access.

    Will send them a support ticket.

     

    Thanks for the help.

  4. Was prompted to update to 3.6 but got message 'cannot find update zip'

    I searched forum and found one answer was to download directly from alfredapp site.

    Unfortunately this did not work either. "Safari cannot find server cachefly.alfredapp.com"

  5. On 20/01/2017 at 5:14 AM, flome said:

    Skol, Colin.

     

    Update: After trying it on my MacOS 10.12.3 Beta (16D30a), the "bounds" property isn't functioning correctly, so the windows do not line up properly, even after playing with the values.

     

    I have the latest release 10.12.2 and it works okay. I will have to wait until 10.12.3 is not in Beta and is released.

  6. Did not work for me either at first.

    Have a look in Alfred's preferences and under 'File Search' there is an Actions button. Click on it.

    From there you can see the default actions. Take note of the hotkey down the bottom. Mine is "option+command+right arrow"

    Then from the Alfred search bar, type in a file name and use down arrow to highlight the file you want then use the hotkey to bring up the actions for that file.

    But there may be an easier way.

     

    EDIT: noticed Andrew answered a similar post a couple of days ago. Looks like you press the fn key during a file search to bring up the actions.

  7. That makes it clearer. I thought that when my Trash was empty it was actually empty. That was until last night when I plugged in my external drive. 

    Thanks for education, I really appreciate the time you have taken to explain it.

     

     

    This is a much smaller script that works well. Hope BermudaLamb can use it. Change the +5 to whatever days you want.

    on adding folder items to this_folder after receiving added_items
    	
    	set files2delete to paragraphs of (do shell script "find " & quoted form of POSIX path of this_folder & " -type f -mtime +5 -delete")
    	
    end adding folder items to
    
  8. Because I am a learner, I collect lots of workflows and scripts just to see how things work. Sometimes a gem comes along.

    I have this little Applescript that I found very useful. Its pretty well documented. I suppose you could use it in Alfred but I do not know how to do it.

    You have to set up Trash Folder Actions and put the Applescript in your Library/Scripts/Folder Action Scripts

     

    EDIT: I did not write this script and I do not remember who did or where I got it.

    on adding folder items to this_folder after receiving added_items
    	try
    		-- Set number of days to wait
    		-- Change this to the number of days you want
    		set time_diff to 7
    		
    		-- Touch all incoming items to update the modified date to now
    		repeat with i from 1 to the number of items in the added_items
    			set a_file to item i of added_items
    			set sh_script to "touch " & quoted form of (POSIX path of a_file)
    			do shell script sh_script
    		end repeat
    		
    		set trash_files to (list folder this_folder without invisibles)
    		-- Set variable "use_date" to the current date to be a little bit more efficient when working with many files
    		set use_date to (current date) - time_diff * days
    		
    		-- Search through the trash and delete files that are there longer than 7 days
    		repeat with i from 1 to the count of trash_files
    			set a_file to alias ((this_folder as text) & (item i of trash_files))
    			if the (modification date of (info for a_file)) comes before use_date then
    				-- "srm -sf" deletes files in a secure way in "simple mode" use "man srm" if you want different modes
    				set sh_script to "srm -sf " & quoted form of (POSIX path of oldest_file)
    				do shell script sh_script
    			end if
    		end repeat
    	end try
    end adding folder items to
    
  9. Not sure if this is exactly what you are after but it may help. It is an applescript I picked up somewhere.

    tell application "Terminal"
    	activate
    	
    	-- Get a window that's not busy.
    	-- If there are no open windows, open one.
    	if (count of windows) is greater than 0 then
    		repeat with currentWindow in windows
    			if currentWindow is not busy then
    				set targetWindow to currentWindow
    			end if
    		end repeat
    	else
    		do script ""
    		set targetWindow to window 1
    	end if
    	
    	-- Do command 1.
    	set firstCommand to "ls"
    	do script firstCommand in targetWindow
    	
    	-- Open a new tab.
    	tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
    	
    	-- Do command 2.
    	set secondCommand to "pwd"
    	do script secondCommand in targetWindow
    	
    	-- And so on...
    end tell
    
    
    
  10. I put this together as a learning exercise because I am just learning.

    It uses an old terminal command named imagesnap http://www.manorts.com/alfred/imagesnap.zip

    Docs are in the archive and if I can understand them, anyone can. There are quite a few options you can use.

    My workflow is real basic. I have a keyword 'snap' followed by a space and argument that activates my script. e.g snap testpic.jpg

    One of the command switches is real handy, imagesnap -t 30. It takes a photo every 30 seconds until you end the script. Good to see who is at your computer during your coffee break.

    on alfred_script(q)
    tell application "Terminal"
    	--activate
    		do script "imagesnap " & q
            delay 5
            quit
    end tell
    end alfred_script
    
    

    Edited the script so terminal window does not open and to put a delay to let the script finish before quitting the Terminal

  11. Okay now. Sifted through a lot of examples trying to get some clues.

    Changed the code to 

    my alfred_script("{query}")
    on alfred_script(q)
    tell application "iTunes"
    pause
    delay q
    play
    end tell
    end alfred_script
    

    Now it works. If I remove the first line, it does not work. What does the first line mean?

     

    I did not understand what to do with the argument following the keyword, now I do so I have learnt something.

     

    EDIT: Where can I find out what {query} does and where it comes  from? Cannot find any reference to it.

  12. Having just purchased the Powerpack, I am now learning how to create workflows.

    I have downloaded several examples just to see how Alfred works.

    This is my first attempt.

    My Alfred workflow is set up with a keyword 'pause' which triggers this script.

    on alfred_script(q)
    tell application "iTunes"
    pause
    delay 10
    play
    end tell
    end alfred_script
    

    It just pauses the song for 10 seconds then resumes.

    The only way I can change the duration is in the delay.

    I want to be able to have 'pause nn' so that nn is the duration.

    Is there a way to do this?

     

    Thanks

×
×
  • Create New...