Friday, November 16, 2018

#1 2018-11-08 10:23:47 am

MitchBVI
Member
Registered: 2006-02-14
Posts: 127

Use GUI to Rename File change its location

I have a script developed form UI Browser. I want to select an item in PDF enter a new name and then move the file. The script below allows me to do that but it is very clumsy having to use a delay statement. What I would like to be bale to do is set the value of the "Rename..." .

any suggestions appreciated.

Applescript:

--To Rename a file and change its location
activate application "PDFpenPro"
tell application "System Events"
tell process "PDFpenPro"
click menu item "Rename…" of menu 1 of menu bar item "File" of menu bar 1
delay 10 --works
--Want to delay so I can complete the box
click menu item "Move To…" of menu 1 of menu bar item "File" of menu bar 1

end tell
end tell

Offline

 

#2 2018-11-08 11:08:49 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3287

Re: Use GUI to Rename File change its location

Trying to help I looked at the app but can't find the menu item  "Rename…".
Here is what I got:

Applescript:

--To Rename a file and change its location
activate application "PDFpenPro"
tell application "System Events"
   tell process "PDFpenPro"
       name of menu bar items of menu bar 1
       --> {"Apple", "PDFpenPro", "Fichier", "Édition", "Présentation", "Format", "Aller", "Outils", "Agencement", "Fenêtre", "Aide", missing value}
       --> {"Apple", "PDFpenPro", "File", "Edit", "View", "Format", "Go", "Tools", "Arrange", "Window", "Help", missing value}
       tell menu bar item 3 of menu bar 1 # get contents of menu "File"
           tell menu 1
               name of menu items
               --> {"Nouveau", "Ouvrir…", "Ouvrir l'élément récent", missing value, "Fermer", "Tout fermer", "Enregistrer", "Enregistrer sous…", "Exporter sous…", "Revenir", missing value, "Saisir le mot de passe…", missing value, "Envoyer le document", "Enregistrer à Evernote…", missing value, "Insérer…", "Importer du scanner…", missing value, "Format d'impression…", "Imprimer…"}
               --> with 8.0.3 {"New", "Open…", "Open Recent", missing value, "Close", "Close All", "Save", "Save As…", "Export…", "Revert", missing value, "Enter Password…", missing value, "Mail Document", "Save to Evernote…", missing value, "Insert…", "Import from Scanner…", missing value, "Page Setup…", "Print…"}
               
               --> with 10.2 {"New", "Open…", "Open Recent", missing value, "Close", "Close All", "Save", "Save As…", "Export…", "Revert", missing value, "Enter Password…", missing value, "Mail Document", "Save to Evernote…", missing value, "Insert…", "Import from Scanner…", missing value, "OCR Files…", missing value, "Page Setup…", "Print…"}
               
           end tell
       end tell
       (*
       click menu item "Rename…" of menu 1 of menu bar item "File" of menu bar 1
       delay 10 --works
       --Want to delay so I can complete the box
       click menu item "Move To…" of menu 1 of menu bar item "File" of menu bar 1
       *)

   end tell
end tell

As you may see, there is no menu item "Rename…" and no more menu item "Move To…"


I did that with PDFPenPro v 8.3.2 in demo mode and with v10.2 in demo mode.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) Thursday 8 November 2018 18:08:22

Last edited by Yvan Koenig (2018-11-08 11:23:17 am)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)